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
Diff: drawStates.h
- Revision:
- 10:9d9b3b9b28b8
- Child:
- 11:1da15361a35b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drawStates.h Wed May 24 11:21:37 2017 +0000 @@ -0,0 +1,69 @@ + + +void draw_state(int i) { + TFT.cls(); + switch (i) { + case (1): + //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); + //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); + //Alarm Area + TFT.rect(185, 0, 320, 1355, White); + //Date Area + TFT.rect(50, 135, 320, 240, White); + break; + case (3): + whiteboard(); + } +} + + + + \ No newline at end of file