pong game added to the main sketch
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of MainSketch by
main.cpp@11:1da15361a35b, 2017-05-24 (annotated)
- Committer:
- mlin
- Date:
- Wed May 24 13:27:07 2017 +0000
- Revision:
- 11:1da15361a35b
- Parent:
- 10:9d9b3b9b28b8
- Child:
- 13:50289d0ac834
updated things;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mlin | 9:eee503060d69 | 1 | #include "libs.h" |
mlin | 9:eee503060d69 | 2 | int f_state, f_button; |
mlin | 9:eee503060d69 | 3 | bool f_alarm; |
mlin | 8:b9aa9fdf286b | 4 | DigitalIn sw_w(SW3); |
cstevens | 6:18c7288b5e00 | 5 | |
mlin | 9:eee503060d69 | 6 | void main() |
dreschpe | 0:7c3b9bfd6ead | 7 | { |
dreschpe | 0:7c3b9bfd6ead | 8 | TFT.claim(stdout); // send stdout to the TFT display |
dreschpe | 0:7c3b9bfd6ead | 9 | TFT.set_orientation(1); |
dreschpe | 0:7c3b9bfd6ead | 10 | TFT.background(Black); // set background to black |
dreschpe | 0:7c3b9bfd6ead | 11 | TFT.foreground(White); // set chars to white |
mlin | 11:1da15361a35b | 12 | TFT.cls(); |
mlin | 11:1da15361a35b | 13 | // pc.baud(115200); |
mlin | 10:9d9b3b9b28b8 | 14 | int i = 0; |
mlin | 10:9d9b3b9b28b8 | 15 | while (true) { |
mlin | 11:1da15361a35b | 16 | i = (i % 3) + 1; |
mlin | 11:1da15361a35b | 17 | draw_state(i); |
mlin | 11:1da15361a35b | 18 | wait(1); |
mlin | 10:9d9b3b9b28b8 | 19 | } |
mlin | 11:1da15361a35b | 20 | |
mlin | 11:1da15361a35b | 21 | |
mlin | 11:1da15361a35b | 22 | |
cstevens | 6:18c7288b5e00 | 23 | |
dreschpe | 0:7c3b9bfd6ead | 24 | } |