This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:ume:smartme:b1 [2019/09/27 13:08] – salvatdi | en:iot-open:remotelab:ume:smartme:b1 [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== B1: Basic operations on the 2x16 LCD screen | + | ==== IB1: Basic operations on the 2x16 LCD screen ==== |
| Whatever you do, you expect to have some output of the system. | Whatever you do, you expect to have some output of the system. | ||
| Line 7: | Line 7: | ||
| Perhaps those are the reasons why you will use the LCD display in every lab work you will do. | Perhaps those are the reasons why you will use the LCD display in every lab work you will do. | ||
| - | ===== Target group ===== | + | === Target group ==== |
| This hands-on lab guide is intended for the Beginners but other target groups may benefit from it, treating it as basics for advanced projects. | This hands-on lab guide is intended for the Beginners but other target groups may benefit from it, treating it as basics for advanced projects. | ||
| - | ===== Prerequisites | + | === Prerequisites === |
| There are no other prerequisites besides the Liquid Crystal library. | There are no other prerequisites besides the Liquid Crystal library. | ||
| - | All the nodes of SmartME Network Laboratory are equipped with an 2x16 LCD Displaytech 162B based on the HD44780 standard. | + | All the nodes of SmartME Network Laboratory are equipped with a 2x16 LCD Displaytech 162B based on the HD44780 standard. |
| It is necessary to initialize the library by associating any pin of the LCD interface to the Arduino pin number to which it is connected (see Step 2). | It is necessary to initialize the library by associating any pin of the LCD interface to the Arduino pin number to which it is connected (see Step 2). | ||
| - | The circuit: | + | == The circuit: |
| * LCD pin 1 = 5v+ (220 ohm resistance) | * LCD pin 1 = 5v+ (220 ohm resistance) | ||
| * LCD pin 2 = GND | * LCD pin 2 = GND | ||
| Line 32: | Line 32: | ||
| - | ===== Scenario | + | === Scenario === |
| Initialize the LCD screen with the text “SmartMe Lab!”, then turn it off, then turn it on again, in a loop: each phase lasting half a second. | Initialize the LCD screen with the text “SmartMe Lab!”, then turn it off, then turn it on again, in a loop: each phase lasting half a second. | ||
| Delays are expressed in ms (milliseconds) and not in s (seconds). | Delays are expressed in ms (milliseconds) and not in s (seconds). | ||
| - | ===== Result | + | === Result === |
| You should see the text "Smart lab!" appearing and disappearing every half second. | You should see the text "Smart lab!" appearing and disappearing every half second. | ||
| - | ===== Start ===== | + | === Start === |
| There are no special steps to be performed. | There are no special steps to be performed. | ||
| - | ===== Steps ===== | + | === Steps === |
| - | ==== Step 1 ==== | + | == Step 1 == |
| Include LCD driver library: | Include LCD driver library: | ||
| Line 53: | Line 53: | ||
| </ | </ | ||
| - | ==== Step 2 ==== | + | == Step 2 == |
| Instantiate the software controller component for the LCD display: | Instantiate the software controller component for the LCD display: | ||
| <code c> | <code c> | ||
| Line 61: | Line 61: | ||
| - | ==== Step 3 ==== | + | == Step 3 == |
| Initialize display - we suggest to do it in the setup() function: | Initialize display - we suggest to do it in the setup() function: | ||
| Line 73: | Line 73: | ||
| </ | </ | ||
| - | ==== Step 4 ==== | + | == Step 4 == |
| Implement loop() to turn off and on the LCD display, for 500 ms each: | Implement loop() to turn off and on the LCD display, for 500 ms each: | ||
| Line 88: | Line 88: | ||
| </ | </ | ||
| - | ===== Result validation | + | === Result validation === |
| Observe the text appearing and disappearing every half second. | Observe the text appearing and disappearing every half second. | ||
| - | ===== Platformio.ini | + | === Platformio.ini === |
| < | < | ||
| [env:uno] | [env:uno] | ||
| Line 106: | Line 106: | ||
| - | ===== B1.cpp ===== | + | === IB1.cpp === |
| <code c> | <code c> | ||
| #include < | #include < | ||