pong game added to the main sketch

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of MainSketch by IoT Ox

Committer:
Owenmatthewmcgowan
Date:
Wed May 24 16:15:04 2017 +0000
Revision:
13:50289d0ac834
Added Settings page

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Owenmatthewmcgowan 13:50289d0ac834 1
Owenmatthewmcgowan 13:50289d0ac834 2
Owenmatthewmcgowan 13:50289d0ac834 3 void drawsettingsbuttons() //Navigation Buttons
Owenmatthewmcgowan 13:50289d0ac834 4 {
Owenmatthewmcgowan 13:50289d0ac834 5 TFT.fillrect(0,0,50,100,Blue); //ste alarm button
Owenmatthewmcgowan 13:50289d0ac834 6 TFT.fillrect(0,100,50,200,White); //set time button
Owenmatthewmcgowan 13:50289d0ac834 7 TFT.fillrect(0,200,50,240,Green); //home button
Owenmatthewmcgowan 13:50289d0ac834 8
Owenmatthewmcgowan 13:50289d0ac834 9
Owenmatthewmcgowan 13:50289d0ac834 10 TFT.rect(0,0,50,100,Blue); //outlines
Owenmatthewmcgowan 13:50289d0ac834 11 TFT.rect(0,100,50,200,White); //outlines
Owenmatthewmcgowan 13:50289d0ac834 12 TFT.rect(0,200,50,240,White); //outlines
Owenmatthewmcgowan 13:50289d0ac834 13
Owenmatthewmcgowan 13:50289d0ac834 14 //set New button (used to set new alarm/time/date)
Owenmatthewmcgowan 13:50289d0ac834 15 TFT.set_font((unsigned char*) Arial12x12);
Owenmatthewmcgowan 13:50289d0ac834 16 TFT.locate(0,40);
Owenmatthewmcgowan 13:50289d0ac834 17 TFT.printf("Set New");
Owenmatthewmcgowan 13:50289d0ac834 18
Owenmatthewmcgowan 13:50289d0ac834 19 //Full reset button
Owenmatthewmcgowan 13:50289d0ac834 20 TFT.locate(0,140);
Owenmatthewmcgowan 13:50289d0ac834 21 TFT.printf("Full reset");
Owenmatthewmcgowan 13:50289d0ac834 22
Owenmatthewmcgowan 13:50289d0ac834 23 //home button
Owenmatthewmcgowan 13:50289d0ac834 24 TFT.locate(0,210);
Owenmatthewmcgowan 13:50289d0ac834 25 TFT.printf("Home");
Owenmatthewmcgowan 13:50289d0ac834 26
Owenmatthewmcgowan 13:50289d0ac834 27 }
Owenmatthewmcgowan 13:50289d0ac834 28
Owenmatthewmcgowan 13:50289d0ac834 29 void drawoutlines() //draw alarm, time, date
Owenmatthewmcgowan 13:50289d0ac834 30 {
Owenmatthewmcgowan 13:50289d0ac834 31 TFT.rect(50,0,320,100,Blue); //set alarm box
Owenmatthewmcgowan 13:50289d0ac834 32 TFT.rect(50,100,320,200,White); //set time box
Owenmatthewmcgowan 13:50289d0ac834 33 TFT.rect(50,200,320,240,White); //set date box
Owenmatthewmcgowan 13:50289d0ac834 34
Owenmatthewmcgowan 13:50289d0ac834 35 TFT.set_font((unsigned char*) Arial12x12); //set alarm title
Owenmatthewmcgowan 13:50289d0ac834 36 TFT.locate(105,0);
Owenmatthewmcgowan 13:50289d0ac834 37 TFT.printf("Set Alarm");
Owenmatthewmcgowan 13:50289d0ac834 38
Owenmatthewmcgowan 13:50289d0ac834 39 TFT.set_font((unsigned char*) Arial28x28); //set alarm hour
Owenmatthewmcgowan 13:50289d0ac834 40 TFT.locate(50,30);
Owenmatthewmcgowan 13:50289d0ac834 41 TFT.printf("Alarm_Hour");
Owenmatthewmcgowan 13:50289d0ac834 42
Owenmatthewmcgowan 13:50289d0ac834 43 //set alarm mins
Owenmatthewmcgowan 13:50289d0ac834 44 TFT.locate(230,30);
Owenmatthewmcgowan 13:50289d0ac834 45 TFT.printf("Alarm_Min");
Owenmatthewmcgowan 13:50289d0ac834 46
Owenmatthewmcgowan 13:50289d0ac834 47 TFT.set_font((unsigned char*) Arial12x12); //set time title
Owenmatthewmcgowan 13:50289d0ac834 48 TFT.locate(105,100);
Owenmatthewmcgowan 13:50289d0ac834 49 TFT.printf("Set Time");
Owenmatthewmcgowan 13:50289d0ac834 50
Owenmatthewmcgowan 13:50289d0ac834 51 TFT.set_font((unsigned char*) Arial28x28); //set time hour
Owenmatthewmcgowan 13:50289d0ac834 52 TFT.locate(50,130);
Owenmatthewmcgowan 13:50289d0ac834 53 TFT.printf("Time_Hour");
Owenmatthewmcgowan 13:50289d0ac834 54
Owenmatthewmcgowan 13:50289d0ac834 55 //set time mins
Owenmatthewmcgowan 13:50289d0ac834 56 TFT.locate(230,130);
Owenmatthewmcgowan 13:50289d0ac834 57 TFT.printf("Alarm_Min");
Owenmatthewmcgowan 13:50289d0ac834 58
Owenmatthewmcgowan 13:50289d0ac834 59 TFT.set_font((unsigned char*) Arial12x12);//set date day
Owenmatthewmcgowan 13:50289d0ac834 60 TFT.locate(50,200);
Owenmatthewmcgowan 13:50289d0ac834 61 TFT.printf("day");
Owenmatthewmcgowan 13:50289d0ac834 62
Owenmatthewmcgowan 13:50289d0ac834 63 //set date month
Owenmatthewmcgowan 13:50289d0ac834 64 TFT.locate(120,200);
Owenmatthewmcgowan 13:50289d0ac834 65 TFT.printf("month");
Owenmatthewmcgowan 13:50289d0ac834 66
Owenmatthewmcgowan 13:50289d0ac834 67 //set date year
Owenmatthewmcgowan 13:50289d0ac834 68 TFT.locate(190,200);
Owenmatthewmcgowan 13:50289d0ac834 69 TFT.printf("year");
Owenmatthewmcgowan 13:50289d0ac834 70
Owenmatthewmcgowan 13:50289d0ac834 71
Owenmatthewmcgowan 13:50289d0ac834 72 }