![](/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:
- 4:cb3a18844abc
- Parent:
- 1:20661421fa4e
- Child:
- 5:eaf6008bf60b
--- a/main.cpp Tue Jan 17 18:36:46 2017 +0000 +++ b/main.cpp Tue Jan 17 18:56:57 2017 +0000 @@ -14,11 +14,12 @@ #include "compass_sensor.h" #include "temp_sensor.h" #include "acceler_sensor.h" +char orient=3; Serial pc(USBTX, USBRX); I2C i2c_port(p9, p10); // configures pins 9,10 for I2C communication with external sensors float temp2; int avg; -const int addr1 = 0x53<<1; +//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; @@ -27,20 +28,27 @@ 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]; + myLCD.set_orientation(orient); + //char sensorData[1]; led1 = 0; led2 = 0; - avg = compass_config(); - temperature_config(); - - acceleration_n(); + //avg = compass_config(); + //temperature_config(); + //acceleration_n(); while(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); + //myLCD.foreground(Black); + //myLCD.background(White); + touch.readTouchData(tx, ty, down); + myLCD.locate(60, 100); + myLCD.printf("A"); + myLCD.circle(60,100,30,Blue); + myLCD.locate(160, 100); + myLCD.printf("C"); + myLCD.circle(160,100,30,Green); + myLCD.locate(260, 100); + myLCD.printf("T"); + myLCD.circle(260,100,30,Red); /*wait(1); i2c_port.start(); // forces start condition if (interupt == 1){