Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of TFT_Mikroelectronika_IL9341_sketchpad by
settings.h@15:796e17680825, 2017-05-25 (annotated)
- Committer:
- Owenmatthewmcgowan
- Date:
- Thu May 25 10:13:49 2017 +0000
- Revision:
- 15:796e17680825
- Parent:
- 13:e74e09de81e4
- Child:
- 20:e4572fc1b10d
Finished settings rendering 11:15 thurs
Who changed what in which revision?
User | Revision | Line number | New 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 | 15:796e17680825 | 25 | void drawsettinganimate() //draw alarm, time, date |
Owenmatthewmcgowan | 12:50289d0ac834 | 26 | { |
Owenmatthewmcgowan | 12:50289d0ac834 | 27 | TFT.rect(50,0,320,100,Blue); //set alarm box |
Owenmatthewmcgowan | 12:50289d0ac834 | 28 | TFT.rect(50,100,320,200,White); //set time box |
Owenmatthewmcgowan | 12:50289d0ac834 | 29 | TFT.rect(50,200,320,240,White); //set date box |
Owenmatthewmcgowan | 13:e74e09de81e4 | 30 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 31 | TFT.set_font((unsigned char*) Arial12x12); //set alarm title |
Owenmatthewmcgowan | 15:796e17680825 | 32 | TFT.locate(157,8); |
Owenmatthewmcgowan | 12:50289d0ac834 | 33 | TFT.printf("Set Alarm"); |
Owenmatthewmcgowan | 12:50289d0ac834 | 34 | TFT.set_font((unsigned char*) Arial28x28); //set alarm hour |
Owenmatthewmcgowan | 15:796e17680825 | 35 | TFT.locate(90,40); |
Owenmatthewmcgowan | 13:e74e09de81e4 | 36 | TFT.printf("AH");//Alarm_Hour |
Owenmatthewmcgowan | 12:50289d0ac834 | 37 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 38 | //set alarm mins |
Owenmatthewmcgowan | 15:796e17680825 | 39 | TFT.locate(230,40); |
Owenmatthewmcgowan | 15:796e17680825 | 40 | TFT.printf("AM");//Alarm_Min |
Owenmatthewmcgowan | 12:50289d0ac834 | 41 | TFT.set_font((unsigned char*) Arial12x12); //set time title |
Owenmatthewmcgowan | 15:796e17680825 | 42 | TFT.locate(157,108); |
Owenmatthewmcgowan | 12:50289d0ac834 | 43 | TFT.printf("Set Time"); |
Owenmatthewmcgowan | 12:50289d0ac834 | 44 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 45 | TFT.set_font((unsigned char*) Arial28x28); //set time hour |
Owenmatthewmcgowan | 15:796e17680825 | 46 | TFT.locate(90,140); |
Owenmatthewmcgowan | 13:e74e09de81e4 | 47 | TFT.printf("TH"); // Time_hour |
Owenmatthewmcgowan | 12:50289d0ac834 | 48 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 49 | //set time mins |
Owenmatthewmcgowan | 15:796e17680825 | 50 | TFT.locate(230,140); |
Owenmatthewmcgowan | 13:e74e09de81e4 | 51 | TFT.printf("TM");//Time Min |
Owenmatthewmcgowan | 12:50289d0ac834 | 52 | |
Owenmatthewmcgowan | 15:796e17680825 | 53 | //set date day |
Owenmatthewmcgowan | 15:796e17680825 | 54 | TFT.set_font((unsigned char*) Arial12x12); |
Owenmatthewmcgowan | 15:796e17680825 | 55 | TFT.locate(60,215); |
Owenmatthewmcgowan | 12:50289d0ac834 | 56 | TFT.printf("day"); |
Owenmatthewmcgowan | 12:50289d0ac834 | 57 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 58 | //set date month |
Owenmatthewmcgowan | 15:796e17680825 | 59 | TFT.locate(150,215); |
Owenmatthewmcgowan | 12:50289d0ac834 | 60 | TFT.printf("month"); |
Owenmatthewmcgowan | 12:50289d0ac834 | 61 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 62 | //set date year |
Owenmatthewmcgowan | 15:796e17680825 | 63 | TFT.locate(265,215); |
Owenmatthewmcgowan | 12:50289d0ac834 | 64 | TFT.printf("year"); |
Owenmatthewmcgowan | 12:50289d0ac834 | 65 | |
Owenmatthewmcgowan | 15:796e17680825 | 66 | //Cancel button |
Owenmatthewmcgowan | 15:796e17680825 | 67 | TFT.set_font((unsigned char*) Arial12x12); |
Owenmatthewmcgowan | 15:796e17680825 | 68 | TFT.locate(62,20); |
Owenmatthewmcgowan | 15:796e17680825 | 69 | TFT.set_orientation(0); |
Owenmatthewmcgowan | 15:796e17680825 | 70 | TFT.background(White); |
Owenmatthewmcgowan | 15:796e17680825 | 71 | TFT.foreground(Black); |
Owenmatthewmcgowan | 15:796e17680825 | 72 | TFT.printf("Cancel"); |
Owenmatthewmcgowan | 15:796e17680825 | 73 | TFT.background(Black); |
Owenmatthewmcgowan | 15:796e17680825 | 74 | TFT.foreground(White); |
Owenmatthewmcgowan | 15:796e17680825 | 75 | TFT.set_orientation(1); |
Owenmatthewmcgowan | 15:796e17680825 | 76 | |
Owenmatthewmcgowan | 15:796e17680825 | 77 | //Set New button (used to set new alarm/time/date) |
Owenmatthewmcgowan | 15:796e17680825 | 78 | |
Owenmatthewmcgowan | 15:796e17680825 | 79 | TFT.locate(161,20); |
Owenmatthewmcgowan | 15:796e17680825 | 80 | TFT.set_orientation(0); |
Owenmatthewmcgowan | 15:796e17680825 | 81 | TFT.background(Blue); |
Owenmatthewmcgowan | 15:796e17680825 | 82 | TFT.printf("Set New"); |
Owenmatthewmcgowan | 15:796e17680825 | 83 | TFT.background(Black); |
Owenmatthewmcgowan | 15:796e17680825 | 84 | TFT.set_orientation(1); |
Owenmatthewmcgowan | 15:796e17680825 | 85 | //home button |
Owenmatthewmcgowan | 15:796e17680825 | 86 | TFT.locate(5,217); |
Owenmatthewmcgowan | 15:796e17680825 | 87 | TFT.foreground(Blue); |
Owenmatthewmcgowan | 15:796e17680825 | 88 | TFT.printf("Home"); |
Owenmatthewmcgowan | 15:796e17680825 | 89 | TFT.foreground(White); |
Owenmatthewmcgowan | 15:796e17680825 | 90 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 91 | |
Owenmatthewmcgowan | 12:50289d0ac834 | 92 | } |