diff --git a/I2C_SLAVE_PHOTORESISTOR/I2C_SLAVE_PHOTORESISTOR.ino b/I2C_SLAVE_PHOTORESISTOR/I2C_SLAVE_PHOTORESISTOR.ino index 4f98c64..545213d 100644 --- a/I2C_SLAVE_PHOTORESISTOR/I2C_SLAVE_PHOTORESISTOR.ino +++ b/I2C_SLAVE_PHOTORESISTOR/I2C_SLAVE_PHOTORESISTOR.ino @@ -6,6 +6,7 @@ int lightPin = 0; void setup() { + pinMode(13, OUTPUT); Wire.begin(7); // join i2c bus with address #7 Wire.onRequest(requestEvent); // register event Serial.begin(9600); //Begin serial communcation @@ -13,11 +14,14 @@ void setup() void loop() { - Serial.println(analogRead(lightPin)); - delay(1000); + //Serial.println(analogRead(lightPin)); + //delay(60000); } void requestEvent() { Wire.write(analogRead(lightPin)); // respond with message of 6 bytes + digitalWrite(13, HIGH); + delay(50); + digitalWrite(13, LOW); }