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
Diff: settings.h
- Revision:
- 27:a895a2c9acb8
- Parent:
- 26:47271cf8d6b2
- Child:
- 28:53a5429976e4
--- a/settings.h Thu May 25 12:25:47 2017 +0000
+++ b/settings.h Thu May 25 12:37:32 2017 +0000
@@ -75,6 +75,9 @@
TFT.set_font((unsigned char*) Arial12x12); //set alarm title
TFT.locate(157,8);
TFT.printf("Set Alarm");
+ TFT.set_font((unsigned char*) Arial12x12); //set time title
+ TFT.locate(157,108);
+ TFT.printf("Set Time");
//Cancel button
TFT.set_font((unsigned char*) Arial12x12);
TFT.locate(62,20);
@@ -111,14 +114,9 @@
TFT.locate(90,40);
TFT.printf("AH");//Alarm_Hour
-
//set alarm mins
TFT.locate(230,40);
TFT.printf("AM");//Alarm_Min
- TFT.set_font((unsigned char*) Arial12x12); //set time title
- TFT.locate(157,108);
- TFT.printf("Set Time");
-
TFT.set_font((unsigned char*) Arial28x28); //set time hour
TFT.locate(90,140);
TFT.printf("TH"); // Time_hour
@@ -165,10 +163,63 @@
{
case(11):
newval = a_h + tsi.d() * multiplier;
+ while (newval < 0) {newval += 24;}
+ a_h = newval % 25;
+ TFT.fillrect(70, 40, 150, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28); //set alarm hour
+ TFT.locate(90,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_h);//Alarm_Hour
+ case(12):
+ newval = a_m + tsi.d() * multiplier;
+ while (newval < 0) {newval += 60;}
+ a_m = newval % 60;
+ TFT.fillrect(200, 40, 300, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28); //set alarm min
+ TFT.locate(230,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_m);//Alarm_Min
+ case(13): //set time hour
+ newval = a_h + tsi.d() * multiplier;
if (newval < 0) newval += 24;
a_h = newval % 25;
TFT.fillrect(90, 40, 150, 80, Black);
- TFT.set_font((unsigned char*) Arial28x28); //set alarm hour
+ TFT.set_font((unsigned char*) Arial28x28);
+ TFT.locate(90,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_h);
+ case(14): //set time min
+ newval = a_h + tsi.d() * multiplier;
+ if (newval < 0) newval += 60;
+ a_h = newval % 60;
+ TFT.fillrect(90, 40, 150, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28);
+ TFT.locate(90,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_h);
+ case(15): // set time date
+ newval = a_h + tsi.d() * multiplier;
+ if (newval < 0) newval += 31;
+ a_h = newval % 32;
+ TFT.fillrect(90, 40, 150, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28);
+ TFT.locate(90,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_h);
+ case(16): // set time month
+ newval = a_h + tsi.d() * multiplier;
+ if (newval < 0) newval += 12;
+ a_h = newval % 13;
+ TFT.fillrect(90, 40, 150, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28);
+ TFT.locate(90,40);
+ TFT.foreground(Red);
+ TFT.printf("%d", a_h);
+ case(17): //set time year
+ newval = a_h + tsi.d() * multiplier;
+ if (newval > 1970 && newval < 2700) a_h = newval;
+ TFT.fillrect(90, 40, 150, 80, Black);
+ TFT.set_font((unsigned char*) Arial28x28);
TFT.locate(90,40);
TFT.foreground(Red);
TFT.printf("%d", a_h);//Alarm_Hour
