![](/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:
- 15:565da8e90073
- Parent:
- 14:682bdfcff46a
- Child:
- 16:995c9920f14e
--- a/main.cpp Tue Jan 17 23:48:14 2017 +0000 +++ b/main.cpp Wed Jan 18 01:08:33 2017 +0000 @@ -32,6 +32,7 @@ uint16_t tx, ty; Ticker inter_t; //Ticker for the touch screen Timer t; +Timeout Response; float accel_x,accel_y,accel_mag; float compass_h; //compass heading float main_data[2]; @@ -134,6 +135,7 @@ accel_mag = sqrt((accel_x*accel_x)+(accel_y*accel_y)); myLCD.locate(80,150); myLCD.printf("%f m/s^2",accel_mag); + } if (choice == 2) //compass { @@ -159,24 +161,9 @@ lastDown = down; } inter_t.attach(&button,10); - } - //getacceleration(); - /*wait(1); - i2c_port.start(); // forces start condition - if (interupt == 1){ - i2c_port.start(); - i2c_port.write(addr1); - i2c_port.write(0x30|0x80); - i2c_port.stop(); - i2c_port.read(addr1,sensorData,1); - wait(1); //checks for interupt signal from accelerometer - if (sensorData[0] & 0x40){ //if one tap - led1 = 1; - temp2 = temperature(); - pc.printf("%f", temp2); - } - if (sensorData[0] & 0x20) { //if two taps - led2 = 1; - compass_n(avg); - }*/ + } } + + + +