Hardware Reference
In-Depth Information
And print these measurements on the serial port:
Serial.print("Temperature: ");
Serial.println(temperature);
Serial.print("Humidity: ");
Serial.println(humidity);
Serial.print("Light level: ");
Serial.println(lightLevel);
Serial.println("");
This is repeated every 500 milliseconds:
delay(500);
Note
The full code can be found inside the GitHub repository of the project at the following
URL:
https://github.com/openhomeautomation/arduino-home-automation/tree/master/chapter4
You can now upload the code to your Arduino board and open the serial monitor. Make
sure that the serial speed is set to 115,200 bauds. You should see the measurement data be-
ing printed every 500 milliseconds:
Temperature: 23.00
Humidity: 40.00
Light level: 728
If that's not the case, you will need to check the hardware connections again. Go through
all the connections again, and make sure they are similar to the connections on the schem-
atics.
Search WWH ::




Custom Search