Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FRDM_MMA8451Q by
main.cpp
00001 #include "mbed.h" 00002 #include "MMA8451Q.h" 00003 00004 #define MMA8451_I2C_ADDRESS (0x1d<<1) 00005 00006 int main(void) { 00007 MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS); 00008 PwmOut rled(LED_RED); 00009 PwmOut gled(LED_GREEN); 00010 PwmOut bled(LED_BLUE); 00011 00012 while (true) { 00013 rled = 1.0 - abs(acc.getAccX()); 00014 gled = 1.0 - abs(acc.getAccY()); 00015 bled = 1.0 - abs(acc.getAccZ()); 00016 wait(0.1); 00017 } 00018 }
Generated on Wed Jul 13 2022 16:12:14 by
