Erik -
/
MMA7660_HelloWorld
Hello World program for MMA7660
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 //Uses the measured z-acceleration to drive leds 2 and 3 of the mbed 00002 00003 #include "mbed.h" 00004 #include "MMA7660.h" 00005 00006 MMA7660 MMA(p28, p27); 00007 00008 DigitalOut connectionLed(LED1); 00009 PwmOut Zaxis_p(LED2); 00010 PwmOut Zaxis_n(LED3); 00011 00012 int main() { 00013 if (MMA.testConnection()) 00014 connectionLed = 1; 00015 00016 while(1) { 00017 Zaxis_p = MMA.z(); 00018 Zaxis_n = -MMA.z(); 00019 } 00020 00021 }
Generated on Tue Jul 12 2022 12:10:56 by 1.7.2