Working on general setpage rendering 15:00 wed
Dependencies: mbed
main.cpp@0:bb7ae3488b3f, 2017-05-24 (annotated)
- Committer:
- Owenmatthewmcgowan
- Date:
- Wed May 24 13:59:55 2017 +0000
- Revision:
- 0:bb7ae3488b3f
- Child:
- 1:1169d3c7571e
Working through general print 15:00 Wed
Who changed what in which revision?
User | Revision | Line number | New 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 | 0:bb7ae3488b3f | 21 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 22 | TFT.set_font((unsigned char*) Arial28x28); //set alarm hour |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 23 | TFT.locate(50,30); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 24 | TFT.printf("Alarm_Hour"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 25 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 26 | TFT.set_font((unsigned char*) Arial28x28); //set alarm hour |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 27 | TFT.locate(50,30); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 28 | TFT.printf("Alarm_Hour"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 29 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 30 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 31 | } |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 32 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 33 | void drawoutlines() //draw alarm, time, date |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 34 | { |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 35 | rect(50,0,320,100,blue); //set alarm box |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 36 | rect(50,100,320,200,white); //set time box |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 37 | rect(50,200,320,240,white); //set date box |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 38 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 39 | } |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 40 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 41 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 42 | //first show the 4 directions |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 43 | TFT.set_orientation(0); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 44 | TFT.background(Black); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 45 | TFT.cls(); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 46 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 47 | TFT.set_font((unsigned char*) Arial12x12); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 48 | TFT.locate(0,0); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 49 | printf(" Hello Mbed 0"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 50 | |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 51 | TFT.set_orientation(1); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 52 | TFT.locate(0,0); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 53 | printf(" Hello Mbed 1"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 54 | TFT.set_orientation(2); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 55 | TFT.locate(0,0); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 56 | printf(" Hello Mbed 2"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 57 | TFT.set_orientation(3); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 58 | TFT.locate(0,0); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 59 | printf(" Hello Mbed 3"); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 60 | TFT.set_orientation(1); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 61 | TFT.set_font((unsigned char*) Arial24x23); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 62 | TFT.locate(50,100); |
Owenmatthewmcgowan | 0:bb7ae3488b3f | 63 | TFT.printf("TFT orientation"); |