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.
Dependencies: C12832 MMA7660 mbed
Fork of app-board-Bubble-Level by
main.cpp
- Committer:
- Sissors
- Date:
- 2012-10-17
- Revision:
- 0:bd0546063b0a
- Child:
- 1:876f52a697c1
File content as of revision 0:bd0546063b0a:
//Uses the measured z-acceleration to drive leds 2 and 3 of the mbed
#include "mbed.h"
#include "MMA7660.h"
MMA7660 MMA(p28, p27);
DigitalOut connectionLed(LED1);
PwmOut Zaxis_p(LED2);
PwmOut Zaxis_n(LED3);
int main() {  
    if (MMA.testConnection())
        connectionLed = 1;
        
    while(1) {
        Zaxis_p = MMA.z();
        Zaxis_n = -MMA.z();
    }
}
            
    