Dependencies: BSP_DISCO_L476VG LCD_DISCO_L476VG mbed-src-AV mbed
Fork of DISCO_L476VG_GlassLCD by
main.cpp@3:68aef4e7d4a3, 2016-07-02 (annotated)
- Committer:
- fsllll
- Date:
- Sat Jul 02 14:00:11 2016 +0000
- Revision:
- 3:68aef4e7d4a3
- Parent:
- 2:16502e83726a
- Child:
- 4:f335e1b6387d
test_2016-07-02
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:0ecb0cbf4c30 | 1 | #include "mbed.h" |
bcostm | 0:0ecb0cbf4c30 | 2 | #include "LCD_DISCO_L476VG.h" |
bcostm | 0:0ecb0cbf4c30 | 3 | |
bcostm | 0:0ecb0cbf4c30 | 4 | LCD_DISCO_L476VG lcd; |
bcostm | 0:0ecb0cbf4c30 | 5 | |
bcostm | 0:0ecb0cbf4c30 | 6 | DigitalOut led_green(LED1); |
bcostm | 0:0ecb0cbf4c30 | 7 | |
bcostm | 0:0ecb0cbf4c30 | 8 | int main() |
bcostm | 0:0ecb0cbf4c30 | 9 | { |
bcostm | 0:0ecb0cbf4c30 | 10 | uint32_t temp = 0; |
bcostm | 0:0ecb0cbf4c30 | 11 | uint8_t stemp[7] = {0}; |
bcostm | 0:0ecb0cbf4c30 | 12 | uint8_t title[] = " DISCOVERY STM32L476"; |
bcostm | 0:0ecb0cbf4c30 | 13 | |
bcostm | 0:0ecb0cbf4c30 | 14 | printf("Hello\n"); |
bcostm | 0:0ecb0cbf4c30 | 15 | led_green = 1; |
bcostm | 0:0ecb0cbf4c30 | 16 | lcd.Clear(); |
fsllll | 3:68aef4e7d4a3 | 17 | // lcd.DisplayString((uint8_t *)"HELLO"); |
fsllll | 3:68aef4e7d4a3 | 18 | // wait(1); |
fsllll | 3:68aef4e7d4a3 | 19 | lcd.DisplayString((uint8_t *)"shuanglin"); |
fsllll | 3:68aef4e7d4a3 | 20 | wait(5); |
bcostm | 0:0ecb0cbf4c30 | 21 | |
bcostm | 0:0ecb0cbf4c30 | 22 | printf("Scroll sequence\n"); |
bcostm | 0:0ecb0cbf4c30 | 23 | led_green = 0; |
bcostm | 0:0ecb0cbf4c30 | 24 | lcd.Clear(); |
bcostm | 0:0ecb0cbf4c30 | 25 | lcd.ScrollSentence(title, 2, 200); |
bcostm | 0:0ecb0cbf4c30 | 26 | lcd.Clear(); |
bcostm | 0:0ecb0cbf4c30 | 27 | |
bcostm | 0:0ecb0cbf4c30 | 28 | while(1) { |
bcostm | 0:0ecb0cbf4c30 | 29 | printf("BAR = %d\n", temp); |
bcostm | 0:0ecb0cbf4c30 | 30 | sprintf((char *)stemp, "BAR %d", temp); |
bcostm | 0:0ecb0cbf4c30 | 31 | lcd.DisplayString(stemp); |
bcostm | 0:0ecb0cbf4c30 | 32 | lcd.BarLevelConfig((uint8_t)temp); |
bcostm | 0:0ecb0cbf4c30 | 33 | temp++; |
bcostm | 0:0ecb0cbf4c30 | 34 | if (temp > 4) temp = 0; |
bcostm | 0:0ecb0cbf4c30 | 35 | led_green = !led_green; |
bcostm | 0:0ecb0cbf4c30 | 36 | wait(1); |
bcostm | 0:0ecb0cbf4c30 | 37 | } |
bcostm | 0:0ecb0cbf4c30 | 38 | } |