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 Oxford CWM Team

drawStates.h

Committer:
Owenmatthewmcgowan
Date:
2017-05-25
Revision:
20:e4572fc1b10d
Parent:
17:356a299d3224
Parent:
15:796e17680825
Child:
22:7a453c1d4d22

File content as of revision 20:e4572fc1b10d:



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);
            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;
    }
}