pong game added to the main sketch
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of MainSketch by
main.cpp@13:50289d0ac834, 2017-05-24 (annotated)
- Committer:
- Owenmatthewmcgowan
- Date:
- Wed May 24 16:15:04 2017 +0000
- Revision:
- 13:50289d0ac834
- Parent:
- 11:1da15361a35b
Added Settings page
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; |
Owenmatthewmcgowan | 13:50289d0ac834 | 3 | //DigitalOut led(LED1); |
mlin | 9:eee503060d69 | 4 | bool f_alarm; |
Owenmatthewmcgowan | 13:50289d0ac834 | 5 | //DigitalIn sw_w(SW3); |
cstevens | 6:18c7288b5e00 | 6 | |
mlin | 9:eee503060d69 | 7 | void main() |
dreschpe | 0:7c3b9bfd6ead | 8 | { |
dreschpe | 0:7c3b9bfd6ead | 9 | TFT.claim(stdout); // send stdout to the TFT display |
dreschpe | 0:7c3b9bfd6ead | 10 | TFT.set_orientation(1); |
dreschpe | 0:7c3b9bfd6ead | 11 | TFT.background(Black); // set background to black |
dreschpe | 0:7c3b9bfd6ead | 12 | TFT.foreground(White); // set chars to white |
mlin | 11:1da15361a35b | 13 | TFT.cls(); |
mlin | 11:1da15361a35b | 14 | // pc.baud(115200); |
Owenmatthewmcgowan | 13:50289d0ac834 | 15 | /*int i = 0; |
mlin | 10:9d9b3b9b28b8 | 16 | while (true) { |
mlin | 11:1da15361a35b | 17 | i = (i % 3) + 1; |
mlin | 11:1da15361a35b | 18 | draw_state(i); |
mlin | 11:1da15361a35b | 19 | wait(1); |
Owenmatthewmcgowan | 13:50289d0ac834 | 20 | }*/ |
Owenmatthewmcgowan | 13:50289d0ac834 | 21 | draw_state(4); |
mlin | 11:1da15361a35b | 22 | |
mlin | 11:1da15361a35b | 23 | |
mlin | 11:1da15361a35b | 24 | |
cstevens | 6:18c7288b5e00 | 25 | |
dreschpe | 0:7c3b9bfd6ead | 26 | } |