The SZ / WakeupLight

Dependencies:   BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src

Committer:
the_sz
Date:
Thu Oct 29 02:30:51 2015 +0000
Revision:
0:995ae8b9afc8
Child:
1:35e2ad5cd1fe
timer int and display string

Who changed what in which revision?

UserRevisionLine numberNew contents of line
the_sz 0:995ae8b9afc8 1 #include "mbed.h"
the_sz 0:995ae8b9afc8 2 #include "TS_DISCO_F746NG.h"
the_sz 0:995ae8b9afc8 3 #include "LCD_DISCO_F746NG.h"
the_sz 0:995ae8b9afc8 4
the_sz 0:995ae8b9afc8 5 LCD_DISCO_F746NG lcd;
the_sz 0:995ae8b9afc8 6 TS_DISCO_F746NG ts;
the_sz 0:995ae8b9afc8 7
the_sz 0:995ae8b9afc8 8 DigitalOut led1(LED1);
the_sz 0:995ae8b9afc8 9 Ticker toggle_led_ticker;
the_sz 0:995ae8b9afc8 10
the_sz 0:995ae8b9afc8 11 void toggle_led()
the_sz 0:995ae8b9afc8 12 {
the_sz 0:995ae8b9afc8 13 led1 = !led1;
the_sz 0:995ae8b9afc8 14 }
the_sz 0:995ae8b9afc8 15
the_sz 0:995ae8b9afc8 16 int main()
the_sz 0:995ae8b9afc8 17 {
the_sz 0:995ae8b9afc8 18 char buffer[100];
the_sz 0:995ae8b9afc8 19 int counter=0;
the_sz 0:995ae8b9afc8 20 led1 = 1;
the_sz 0:995ae8b9afc8 21
the_sz 0:995ae8b9afc8 22 toggle_led_ticker.attach(&toggle_led, 0.2);
the_sz 0:995ae8b9afc8 23 while(1)
the_sz 0:995ae8b9afc8 24 {
the_sz 0:995ae8b9afc8 25 wait(0.2);
the_sz 0:995ae8b9afc8 26
the_sz 0:995ae8b9afc8 27 snprintf(buffer,sizeof(buffer),"%u",counter);
the_sz 0:995ae8b9afc8 28 counter++;
the_sz 0:995ae8b9afc8 29 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)buffer, CENTER_MODE);
the_sz 0:995ae8b9afc8 30 }
the_sz 0:995ae8b9afc8 31 }