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.
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
