IoT Ox / Mbed 2 deprecated MainSketch Featured

Dependencies:   RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor

Fork of TFT_Mikroelectronika_IL9341_sketchpad by Oxford CWM Team

Committer:
Owenmatthewmcgowan
Date:
Thu May 25 11:04:31 2017 +0000
Revision:
20:e4572fc1b10d
Parent:
18:02667782b06f
Parent:
15:796e17680825
Child:
24:93e1474d6d8b
working demo updated with settings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Owenmatthewmcgowan 12:50289d0ac834 1
Owenmatthewmcgowan 12:50289d0ac834 2
Owenmatthewmcgowan 15:796e17680825 3 void drawsettingback() //Navigation Buttons
Owenmatthewmcgowan 12:50289d0ac834 4 {
Owenmatthewmcgowan 15:796e17680825 5 TFT.fillrect(0,0,50,100,Blue); //set alarm button
Owenmatthewmcgowan 12:50289d0ac834 6 TFT.fillrect(0,100,50,200,White); //set time button
Owenmatthewmcgowan 12:50289d0ac834 7
Owenmatthewmcgowan 12:50289d0ac834 8
Owenmatthewmcgowan 12:50289d0ac834 9 TFT.rect(0,0,50,100,Blue); //outlines
Owenmatthewmcgowan 12:50289d0ac834 10 TFT.rect(0,100,50,200,White); //outlines
Owenmatthewmcgowan 12:50289d0ac834 11 TFT.rect(0,200,50,240,White); //outlines
Owenmatthewmcgowan 12:50289d0ac834 12
Owenmatthewmcgowan 15:796e17680825 13 //alarm/time colons
Owenmatthewmcgowan 15:796e17680825 14 int tx,ty = 0;
Owenmatthewmcgowan 15:796e17680825 15 ty = 50;
Owenmatthewmcgowan 15:796e17680825 16 tx = 185;
Owenmatthewmcgowan 15:796e17680825 17 TFT.fillcircle(tx, ty - 10, 2, White);
Owenmatthewmcgowan 15:796e17680825 18 TFT.fillcircle(tx, ty + 10, 2, White);
Owenmatthewmcgowan 15:796e17680825 19 ty = 150;
Owenmatthewmcgowan 15:796e17680825 20 TFT.fillcircle(tx, ty - 10, 2, White);
Owenmatthewmcgowan 15:796e17680825 21 TFT.fillcircle(tx, ty + 10, 2, White);
Owenmatthewmcgowan 13:e74e09de81e4 22
Owenmatthewmcgowan 12:50289d0ac834 23
Owenmatthewmcgowan 12:50289d0ac834 24 }
Owenmatthewmcgowan 12:50289d0ac834 25
Owenmatthewmcgowan 15:796e17680825 26 void drawsettinganimate() //draw alarm, time, date
Owenmatthewmcgowan 12:50289d0ac834 27 {
Owenmatthewmcgowan 12:50289d0ac834 28 TFT.rect(50,0,320,100,Blue); //set alarm box
Owenmatthewmcgowan 12:50289d0ac834 29 TFT.rect(50,100,320,200,White); //set time box
Owenmatthewmcgowan 12:50289d0ac834 30 TFT.rect(50,200,320,240,White); //set date box
Owenmatthewmcgowan 13:e74e09de81e4 31
Owenmatthewmcgowan 12:50289d0ac834 32 TFT.set_font((unsigned char*) Arial12x12); //set alarm title
Owenmatthewmcgowan 15:796e17680825 33 TFT.locate(157,8);
Owenmatthewmcgowan 12:50289d0ac834 34 TFT.printf("Set Alarm");
Owenmatthewmcgowan 12:50289d0ac834 35
mlin 18:02667782b06f 36
Owenmatthewmcgowan 12:50289d0ac834 37 TFT.set_font((unsigned char*) Arial28x28); //set alarm hour
mlin 18:02667782b06f 38
Owenmatthewmcgowan 15:796e17680825 39 TFT.locate(90,40);
Owenmatthewmcgowan 20:e4572fc1b10d 40
Owenmatthewmcgowan 13:e74e09de81e4 41 TFT.printf("AH");//Alarm_Hour
Owenmatthewmcgowan 12:50289d0ac834 42
Owenmatthewmcgowan 12:50289d0ac834 43 //set alarm mins
Owenmatthewmcgowan 15:796e17680825 44 TFT.locate(230,40);
Owenmatthewmcgowan 15:796e17680825 45 TFT.printf("AM");//Alarm_Min
Owenmatthewmcgowan 12:50289d0ac834 46 TFT.set_font((unsigned char*) Arial12x12); //set time title
Owenmatthewmcgowan 15:796e17680825 47 TFT.locate(157,108);
Owenmatthewmcgowan 12:50289d0ac834 48 TFT.printf("Set Time");
Owenmatthewmcgowan 12:50289d0ac834 49
Owenmatthewmcgowan 12:50289d0ac834 50 TFT.set_font((unsigned char*) Arial28x28); //set time hour
Owenmatthewmcgowan 15:796e17680825 51 TFT.locate(90,140);
Owenmatthewmcgowan 13:e74e09de81e4 52 TFT.printf("TH"); // Time_hour
Owenmatthewmcgowan 12:50289d0ac834 53
Owenmatthewmcgowan 12:50289d0ac834 54 //set time mins
Owenmatthewmcgowan 15:796e17680825 55 TFT.locate(230,140);
Owenmatthewmcgowan 13:e74e09de81e4 56 TFT.printf("TM");//Time Min
Owenmatthewmcgowan 12:50289d0ac834 57
Owenmatthewmcgowan 15:796e17680825 58 //set date day
Owenmatthewmcgowan 15:796e17680825 59 TFT.set_font((unsigned char*) Arial12x12);
Owenmatthewmcgowan 15:796e17680825 60 TFT.locate(60,215);
Owenmatthewmcgowan 12:50289d0ac834 61 TFT.printf("day");
Owenmatthewmcgowan 12:50289d0ac834 62
Owenmatthewmcgowan 12:50289d0ac834 63 //set date month
Owenmatthewmcgowan 15:796e17680825 64 TFT.locate(150,215);
Owenmatthewmcgowan 12:50289d0ac834 65 TFT.printf("month");
Owenmatthewmcgowan 12:50289d0ac834 66
Owenmatthewmcgowan 12:50289d0ac834 67 //set date year
Owenmatthewmcgowan 15:796e17680825 68 TFT.locate(265,215);
Owenmatthewmcgowan 12:50289d0ac834 69 TFT.printf("year");
Owenmatthewmcgowan 12:50289d0ac834 70
Owenmatthewmcgowan 15:796e17680825 71 //Cancel button
Owenmatthewmcgowan 15:796e17680825 72 TFT.set_font((unsigned char*) Arial12x12);
Owenmatthewmcgowan 15:796e17680825 73 TFT.locate(62,20);
Owenmatthewmcgowan 15:796e17680825 74 TFT.set_orientation(0);
Owenmatthewmcgowan 15:796e17680825 75 TFT.background(White);
Owenmatthewmcgowan 15:796e17680825 76 TFT.foreground(Black);
Owenmatthewmcgowan 15:796e17680825 77 TFT.printf("Cancel");
Owenmatthewmcgowan 15:796e17680825 78 TFT.background(Black);
Owenmatthewmcgowan 15:796e17680825 79 TFT.foreground(White);
Owenmatthewmcgowan 15:796e17680825 80 TFT.set_orientation(1);
Owenmatthewmcgowan 15:796e17680825 81
Owenmatthewmcgowan 15:796e17680825 82 //Set New button (used to set new alarm/time/date)
Owenmatthewmcgowan 15:796e17680825 83
Owenmatthewmcgowan 15:796e17680825 84 TFT.locate(161,20);
Owenmatthewmcgowan 15:796e17680825 85 TFT.set_orientation(0);
Owenmatthewmcgowan 15:796e17680825 86 TFT.background(Blue);
Owenmatthewmcgowan 15:796e17680825 87 TFT.printf("Set New");
Owenmatthewmcgowan 15:796e17680825 88 TFT.background(Black);
Owenmatthewmcgowan 15:796e17680825 89 TFT.set_orientation(1);
Owenmatthewmcgowan 15:796e17680825 90 //home button
Owenmatthewmcgowan 15:796e17680825 91 TFT.locate(5,217);
Owenmatthewmcgowan 15:796e17680825 92 TFT.foreground(Blue);
Owenmatthewmcgowan 15:796e17680825 93 TFT.printf("Home");
Owenmatthewmcgowan 15:796e17680825 94 TFT.foreground(White);
Owenmatthewmcgowan 15:796e17680825 95
Owenmatthewmcgowan 12:50289d0ac834 96
mlin 16:3cb9b1fbc039 97 }
mlin 16:3cb9b1fbc039 98 void settingslogic() {
mlin 16:3cb9b1fbc039 99
mlin 16:3cb9b1fbc039 100 }