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:b1 [2018/12/27 10:53] – external edit 127.0.0.1 | en:iot-open:remotelab:sut:generalpurpose2:b1 [2020/10/25 10:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Temperature and humidity | + | ==== B1: Basic operations on the 4x20 LCD screen |
| - | //Give few words about this scenario. Provide | + | Whatever you do, you expect to have some output of the system. Sometimes there is a blinking LED, sometimes information about connected/ |
| + | |||
| + | <note important> | ||
| === Target group === | === Target group === | ||
| - | //This hands-on lab guide is intended for the Beginners/ | + | This hands-on lab guide is intended for the Beginners |
| === Prerequisites === | === Prerequisites === | ||
| - | //Provide prerequisite readings/ | + | There are no other prerequisites |
| + | |||
| + | <note important> | ||
| + | * Nodes 1 through 5, 8 and 9 use 0x3F | ||
| + | * Nodes 10 and 11 use 0x27 | ||
| + | </note> | ||
| === Scenario === | === Scenario === | ||
| - | //Describe scenario to let the user understand its idea and process. Write information about the approach, algorithm, etc. (depends on the lab). Provide useful information about protocols, assumptions, | + | Initialize LCD screen, clear it then write some fancy text on it, i.e. "Hello IOT!" in the first line then your first name in the second line and the name of the city you're in, in the third. In the fourth line, print right-aligned number of '' |
| === Result === | === Result === | ||
| - | //Describe expected result when scenario is finished.// | + | You should see the texts and ticking counter in the video stream. |
| === Start === | === Start === | ||
| - | //Write starting conditions, i.e. what to do at the beginning, what to pay attention before beginning, how the mechanical part should look like, etc.// | + | There are no special steps to be performed. |
| === Steps === | === Steps === | ||
| - | // Write some extra information if i.e. some steps are optional otherwise cancel this paragraph (but do not remove header).// | ||
| - | == Step 1 == | ||
| - | //Describe activities done in Step 1.// | ||
| + | == Step 1 == | ||
| + | Include LCD driver library: | ||
| + | <code c> | ||
| + | #include < | ||
| + | </ | ||
| + | == Step 2 == | ||
| + | Instantiate software controler component for the LCD display: | ||
| + | <code c> | ||
| + | LiquidCrystal_I2C lcd(0x3F, | ||
| + | // | ||
| + | // for a 20 chars and 4 line display | ||
| + | </ | ||
| + | == Step 3 == | ||
| + | Declare some variables: counter '' | ||
| + | <code c> | ||
| + | int i = 0; | ||
| + | char buffer [50]; | ||
| + | int n; | ||
| + | </ | ||
| + | We will use them in further part of the code. | ||
| + | == Step 3 == | ||
| + | Initialize display - we suggest to do it in '' | ||
| + | <code c> | ||
| ... | ... | ||
| - | + | lcd.init(D2, | |
| - | == Step n == | + | lcd.backlight(); |
| - | //Describe activities done in Step n.// | + | ... |
| + | </ | ||
| + | == Step 4 == | ||
| + | Clear the contents, set cursor and draw static text - still in '' | ||
| + | <code c> | ||
| + | ... | ||
| + | lcd.home(); | ||
| + | lcd.print(" | ||
| + | lcd.setCursor(0, | ||
| + | lcd.print(" | ||
| + | lcd.setCursor(0, | ||
| + | lcd.print(" | ||
| + | ... | ||
| + | </ | ||
| + | == Step 5 == | ||
| + | Implement '' | ||
| + | <code c> | ||
| + | ... | ||
| + | i++; | ||
| + | | ||
| + | lcd.setCursor(20-n, | ||
| + | lcd.print(i); | ||
| + | delay(1000); | ||
| + | ... | ||
| + | </code> | ||
| + | <note tip>'' | ||
| === Result validation === | === Result validation === | ||
| - | //Provide some result validation methods, for self assesment.// | + | Observe text, its position and counter ticking in lower, right corner. |
| - | === FAQ === | ||
| - | This section is to be extended as new questions appear. \\ | ||
| - | When using the printed version of this manual please refer to the latest online version of this document to obtain the valid and up-to-date list of the FAQ. | ||
| - | //Provide some FAQs in the following form:\\ | ||
| - | **Question? | ||
| - | // | ||