Example using LIS302 accelerometer printing values over USB serial

Dependencies:   mbed

main.cpp

Committer:
chris
Date:
2010-03-23
Revision:
1:05bd934b3abd
Parent:
0:9caf9cb82de0

File content as of revision 1:05bd934b3abd:

#include "mbed.h" 
#include "LIS302.h" 

DigitalOut led (LED1);  
LIS302 acc(p11, p12, p13, p10); // mosi, miso, clk, ncs 
 
int main() { 

    for (int i = 0; i < 100; i++) { 
        printf("%.2f, %.2f, %.2f\n", acc.x(),acc.y(),acc.z()); 
        wait(0.1);               
    } 
    
    led = 1; // done!
}