Simon Ford
/
LIS302_HelloWorld
Hello World for the LIS302 accelerometer library
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 // LIS302 Hello World! moves leds based on x acceleration 00002 00003 #include "mbed.h" 00004 #include "LIS302.h" 00005 00006 LIS302 acc(p5, p6, p7, p8); // mosi, miso, sclk, ncs 00007 BusOut leds(LED1, LED2, LED3, LED4); 00008 00009 int main() { 00010 while(1) { 00011 leds = 1 << (int)(4 * acc.x()); 00012 wait(0.1); 00013 } 00014 }
Generated on Tue Jul 12 2022 11:48:12 by 1.7.2