Working on general setpage rendering 15:00 wed

Dependencies:   mbed

Committer:
Owenmatthewmcgowan
Date:
Wed May 24 14:31:30 2017 +0000
Revision:
2:cfa689f0ef30
Parent:
1:1169d3c7571e
forgot the date 15:30 wed

Who changed what in which revision?

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