Simon Ford
/
LIS302_HelloWorld
Hello World for the LIS302 accelerometer library
main.cpp
- Committer:
- simon
- Date:
- 2010-09-02
- Revision:
- 1:768e44d2e442
- Parent:
- 0:676c81a790ac
File content as of revision 1:768e44d2e442:
// LIS302 Hello World! moves leds based on x acceleration #include "mbed.h" #include "LIS302.h" LIS302 acc(p5, p6, p7, p8); // mosi, miso, sclk, ncs BusOut leds(LED1, LED2, LED3, LED4); int main() { while(1) { leds = 1 << (int)(4 * acc.x()); wait(0.1); } }