Contains the main execution of the clock uses headers to import functions
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of TFT_Mikroelectronika_IL9341_sketchpad by
drawStates.h
- Committer:
- mlin
- Date:
- 2017-05-25
- Revision:
- 22:7a453c1d4d22
- Parent:
- 20:e4572fc1b10d
- Child:
- 29:684e2a3e17b5
File content as of revision 22:7a453c1d4d22:
void draw_state(int i) { TFT.cls(); switch (i) { case (1): //buttons TFT.fillrect(0, 0, 50, 50, Red); TFT.background(Red); TFT.locate(2,5); TFT.set_font((unsigned char*) Arial12x12); TFT.printf("Dig/\n\rALog"); TFT.fillrect(0, 50, 50, 100, Green); TFT.background(Green); TFT.locate(2, 55); TFT.printf("Set\n\rTime"); TFT.fillrect(0, 100, 50, 150, Blue); TFT.background(Blue); TFT.locate(2, 105); TFT.printf("Draw"); TFT.background(White); TFT.fillrect(0, 150, 50, 200, White); TFT.foreground(Black); TFT.locate(2,155); TFT.printf("Pong"); TFT.background(Black); TFT.foreground(White); TFT.fillrect(0, 200, 50, 240, Black); TFT.locate(2, 205); TFT.printf("Home"); TFT.rect(0, 0, 50, 50, White); TFT.rect(0, 50, 50, 100, White); TFT.rect(0, 100, 50, 150, White); TFT.rect(0, 150, 50, 200, White); TFT.rect(0, 200, 50, 240, White); //clock area TFT.rect(50, 0, 320, 100, White); //Day TFT.rect(50, 100, 140, 200, White); //Alarm Area TFT.rect(140, 100 , 320, 200, White); //Date Area TFT.rect(50, 200, 320, 240, White); //Colons int tx,ty = 0; ty = 50; tx = 140; TFT.fillcircle(tx, ty - 10, 2, White); TFT.fillcircle(tx, ty + 10, 2, White); tx = 230; TFT.fillcircle(tx, ty - 10, 2, White); TFT.fillcircle(tx, ty + 10, 2, White); ty = 150; TFT.fillcircle(tx, ty - 10, 2, White); TFT.fillcircle(tx, ty + 10, 2, White); break; case (2): //buttons TFT.fillrect(0, 0, 50, 50, Red); TFT.fillrect(0, 50, 50, 100, Green); TFT.fillrect(0, 100, 50, 150, Blue); TFT.fillrect(0, 150, 50, 200, White); TFT.fillrect(0, 200, 50, 240, Black); TFT.rect(0, 0, 50, 50, White); TFT.rect(0, 50, 50, 100, White); TFT.rect(0, 100, 50, 150, White); TFT.rect(0, 150, 50, 200, White); TFT.rect(0, 200, 50, 240, White); //Date Area //clock area TFT.rect(50, 0, 185, 1355, White); int r = 135/2; draw_clockface(50 + r, r, r, 3, White); //Alarm Area draw_clockface(185 + r, r, r, 3, White); TFT.rect(185, 0, 320, 1355, White); //Date Area TFT.rect(50, 135, 320, 240, White); break; case (4): whiteboard(); break; case(3): drawsettingback(); drawsettinganimate(); break; } }