File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 4
4
.vscode /launch.json
5
5
.vscode /ipch
6
6
.DS_Store
7
- aws /lambdas /weather-station-writer /.serverless
8
- aws /cfn-templates /real-time-iot-device-monitoring-with-kinesis.template
9
- cmake-build-uno /
10
- cmake-build-debug
11
- CMakeLists.txt
12
- CMakeListsPrivate.txt
13
- .idea
7
+ aws /lambdas /weather-station-writer /.serverless
Original file line number Diff line number Diff line change @@ -105,11 +105,6 @@ void setup() {
105
105
lcd.blink ();
106
106
delay (3000 );
107
107
lcd.noBlink ();
108
-
109
- if (!uvSensor.begin ()) {
110
- Serial.println (" Didn't find Si1145" );
111
- while (1 );
112
- }
113
108
}
114
109
115
110
void loop () {
@@ -132,20 +127,22 @@ void loop() {
132
127
Serial.println (" endbuffer" );
133
128
}
134
129
135
- // read from the digital pin
130
+ // read from DHT11
136
131
temperatureSensor.begin ();
137
132
133
+ if (!uvSensor.begin ()) {
134
+ Serial.println (" Didn't find Si1145" );
135
+ }
136
+
138
137
float temperature = temperatureSensor.readTemperature (); // return temperature in °C
139
138
float humidity = temperatureSensor.readHumidity (); // return humidity in %
139
+ // Compute heat index in Celsius (isFahrenheit = false)
140
+ float heatIndex = temperatureSensor.computeHeatIndex (temperature, humidity, false );
140
141
float uvIndex = uvSensor.readUV (); // the index is multiplied by 100 so to get the
141
142
142
143
// integer index, divide by 100!
143
144
uvIndex /= 100.0 ;
144
145
145
- // Compute heat index in Celsius (isFahrenheit = false)
146
- float heatIndex = temperatureSensor.computeHeatIndex (temperature, humidity, false );
147
-
148
-
149
146
// check whether reading was successful or not
150
147
if (temperature == NAN || humidity == NAN) { // NAN means no available data
151
148
lcd.print (" Reading failed." );
You can’t perform that action at this time.
0 commit comments