![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Mini Project 10: Displaying stuff from day 7
Dependencies: DmTouch_UniGraphic UniGraphic mbed
Diff: main.cpp
- Revision:
- 1:20661421fa4e
- Parent:
- 0:1ebe73e062a7
- Child:
- 2:1119063eb8f2
- Child:
- 4:cb3a18844abc
diff -r 1ebe73e062a7 -r 20661421fa4e main.cpp --- a/main.cpp Tue Jan 17 18:14:15 2017 +0000 +++ b/main.cpp Tue Jan 17 18:36:46 2017 +0000 @@ -1,6 +1,15 @@ //MiniProject Day 7 //If tapped, the mbed will either read from a temperature sensor or the compass +#include "stdio.h" +#include "mbed.h" +#include "string" +#include "ILI932x.h" +#include "DmTouch.h" + +#include "Arial12x12.h" +#include "Arial24x23.h" +//#include "pavement_48x34.h" #include "mbed.h" #include "compass_sensor.h" #include "temp_sensor.h" @@ -12,7 +21,11 @@ const int addr1 = 0x53<<1; DigitalOut led1(LED1); // configures mbed internal LED 1 DigitalOut led2(LED2); // configures mbed internal LED 2 -DigitalIn interupt(p20); // sets accelerometer interupt as digital input at pin 20; +DigitalIn interupt(p20); // sets accelerometer interupt as digital input at pin 20; +DmTouch touch(DmTouch::DM_TFT24_104, p5, p6, p7, p8, p9); +PinName dataBus[]= {p30, p29, p28, p27, p26, p25, p24, p23}; +ILI932x myLCD(BUS_8, dataBus, p15, p17, p16, p14, p20, "myLCD", 240, 320); // Bus 8 bit, bus pin array, CS, RST, DC, WR, RD, name, xpixels, ypixels + int main() { char sensorData[1]; led1 = 0; @@ -22,7 +35,13 @@ acceleration_n(); while(1){ - wait(1); + myLCD.set_font((unsigned char*) Arial24x23); + myLCD.background(White); + myLCD.foreground(Black); + myLCD.circle(100,132,30,Red); + myLCD.circle(150,132,30,Blue); + myLCD.circle(200,132,30,Green); + /*wait(1); i2c_port.start(); // forces start condition if (interupt == 1){ i2c_port.start(); @@ -39,7 +58,6 @@ if (sensorData[0] & 0x20) { //if two taps led2 = 1; compass_n(avg); - } + }*/ } } -}