Hello World for the LIS302 accelerometer library

Dependencies:   mbed LIS302

Committer:
simon
Date:
Thu Sep 02 17:59:57 2010 +0000
Revision:
1:768e44d2e442
Parent:
0:676c81a790ac
Add tags, comments, and publish using LIS302 library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 1:768e44d2e442 1 // LIS302 Hello World! moves leds based on x acceleration
simon 1:768e44d2e442 2
simon 1:768e44d2e442 3 #include "mbed.h"
simon 1:768e44d2e442 4 #include "LIS302.h"
simon 1:768e44d2e442 5
simon 1:768e44d2e442 6 LIS302 acc(p5, p6, p7, p8); // mosi, miso, sclk, ncs
simon 1:768e44d2e442 7 BusOut leds(LED1, LED2, LED3, LED4);
simon 1:768e44d2e442 8
simon 1:768e44d2e442 9 int main() {
simon 1:768e44d2e442 10 while(1) {
simon 1:768e44d2e442 11 leds = 1 << (int)(4 * acc.x());
simon 1:768e44d2e442 12 wait(0.1);
simon 1:768e44d2e442 13 }
simon 1:768e44d2e442 14 }