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 [2020/05/13 08:47] – pczekalski | en:iot-open:remotelab:sut:generalpurpose2 [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| ==== Technical details for the flap position monitor ==== | ==== Technical details for the flap position monitor ==== | ||
| - | End of the air duct is fitted to rectangle flap, The flap is hanging loosely and can be pushed by the airflow. The flap is lighted by LED form the top, and at the opposite side of the flap, there is the photoresistor, | + | The end of the air duct is fitted to a rectangle flap, The flap is hanging loosely and can be pushed by the airflow. The flap is lighted by LED form the top, and at the opposite side of the flap, there is the photoresistor, |
| {{: | {{: | ||
| - | Independent, | + | Independent, |
| {{: | {{: | ||
| Line 42: | Line 42: | ||
| LiquidCrystal_I2C lcd(0x3F, | LiquidCrystal_I2C lcd(0x3F, | ||
| // for a 20 chars and 4 line display | // for a 20 chars and 4 line display | ||
| - | </ | ||
| - | |||
| - | === Platformio.ini === | ||
| - | < | ||
| - | ; PlatformIO Project Configuration File | ||
| - | ; | ||
| - | ; Build options: build flags, source filter | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; Please visit documentation for the other options and examples | ||
| - | ; http:// | ||
| - | |||
| - | [env: | ||
| - | platform = espressif8266 | ||
| - | board = d1_mini | ||
| - | framework = arduino | ||
| - | lib_deps = Wire, EmonLib, Adafruit NeoPixel, Encoder,DHT sensor library, | ||
| - | Adafruit Unified Sensor, | ||
| - | LCD, PubSubClient, | ||
| </ | </ | ||
| Line 84: | Line 63: | ||
| ===== Support ===== | ===== Support ===== | ||
| - | gabriel.drabik@polsl.pl | + | In case the LCD display hangs and you are sure that your code should work but it does not, it may be the case the I2C bus is stuck and hang the I2C to LCD controller converter.\\ |
| + | In this case, please use the following code to reset the I2C bus (you can embed it to your source code or run separately, then run your original code, again): | ||
| + | <code c> | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | LiquidCrystal_I2C lcd(0x3F, | ||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | pinMode(4, | ||
| + | pinMode(5, OUTPUT); | ||
| + | digitalWrite(4, | ||
| + | digitalWrite(5, | ||
| + | delay(2000); | ||
| + | pinMode(5, INPUT); | ||
| + | pinMode(4, INPUT); | ||
| + | delay(2050); | ||
| + | lcd.init(D2, | ||
| + | lcd.backlight(); | ||
| + | lcd.home(); | ||
| + | lcd.print(" | ||
| + | } | ||
| + | void loop() | ||
| + | { | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | Finally, you should see Hello World message on the LCD and I2C bus should be recovered now. | ||