This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:sut:generalpurpose2:b2 [2020/10/25 08:38] – pczekalski | en:iot-open:remotelab:sut:generalpurpose2:b2 [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== B2: Presenting temperature and humidity on the LCD ==== | ==== B2: Presenting temperature and humidity on the LCD ==== | ||
| - | In this scenario, you will present temperature and humidity as read by the attached | + | In this scenario, you will present temperature and humidity as read by the attached |
| === Target group === | === Target group === | ||
| Beginners | Beginners | ||
| Line 10: | Line 10: | ||
| #include < | #include < | ||
| </ | </ | ||
| - | The temperature and humidity sensor is all-in-one, | + | The temperature and humidity sensor is all-in-one, DHT11, connected to the pin D4. Observe your camera to check which sensor is equipped with your lab and consult node documentation.\\ |
| To read data you may use a dedicated library (libraries): | To read data you may use a dedicated library (libraries): | ||
| <code c> | <code c> | ||
| Line 18: | Line 18: | ||
| === Scenario === | === Scenario === | ||
| Once you initialise sensor and LCD display, read sensor data (temperature and humidity, mind they' | Once you initialise sensor and LCD display, read sensor data (temperature and humidity, mind they' | ||
| - | <note warning> | + | <note warning> |
| The first line of the LCD should display: "// | The first line of the LCD should display: "// | ||
| The second line should provide temperature within the "// | The second line should provide temperature within the "// | ||
| Line 42: | Line 42: | ||
| == Step 2 == | == Step 2 == | ||
| - | Instantiate software | + | Instantiate software |
| <code c> | <code c> | ||
| LiquidCrystal_I2C lcd(0x3F, | LiquidCrystal_I2C lcd(0x3F, | ||
| // | // | ||
| // for a 20 chars and 4 line display | // for a 20 chars and 4 line display | ||
| - | DHT dht(DHTpin,DHT22,50); | + | DHT dht(DHTpin, |
| </ | </ | ||
| == Step 3 == | == Step 3 == | ||
| Line 86: | Line 86: | ||
| ... | ... | ||
| </ | </ | ||
| - | <note tip>'' | + | <note tip>'' |
| + | <code c> | ||
| + | delay(time) | ||
| + | </ | ||
| === Result validation === | === Result validation === | ||
| - | Observe temperature and humidity readings on the LCD. The temperature in our lab usually ranges between 20-30C (not, we observed over 30C during really hot summer!) while humidity is usually between | + | Observe temperature and humidity readings on the LCD. The temperature in our lab usually ranges between 20-30C (not, we observed over 30C during really hot summer!) while humidity is usually between |