![](/media/cache/profiles/DalekSelfie2.jpg.50x50_q85.jpg)
FRDM-KL25Z with Nokia 3110 type LCD display Using accelerometer to make movements
Dependencies: MMA8451Q N3310LCD mbed
Fork of FRDM_MMA8451Q by
Diff: main.cpp
- Revision:
- 5:bf5becf7469c
- Parent:
- 4:367de1084ea9
- Child:
- 8:857444086b3f
--- a/main.cpp Fri Oct 12 11:35:21 2012 +0000 +++ b/main.cpp Tue Oct 23 09:25:15 2012 +0000 @@ -4,13 +4,12 @@ #define MMA8451_I2C_ADDRESS (0x1d<<1) int main(void) { + MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS); + PwmOut rled(LED_RED); + PwmOut gled(LED_GREEN); + PwmOut bled(LED_BLUE); -MMA8451Q acc(P_E25, P_E24, MMA8451_I2C_ADDRESS); -PwmOut rled(LED_RED); -PwmOut gled(LED_GREEN); -PwmOut bled(LED_BLUE); - - while (true) { + while (true) { rled = 1.0 - abs(acc.getAccX()); gled = 1.0 - abs(acc.getAccY()); bled = 1.0 - abs(acc.getAccZ());