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: 4DGL-uLCD-SE LSM9DS1_Library
main.cpp
00001 #include "mbed.h" 00002 #include "uLCD_4DGL.h" 00003 #include "LSM9DS1.h" 00004 00005 uLCD_4DGL uLCD(p13,p14,p30); // LCD (serial tx, serial rx, reset pin;) 00006 LSM9DS1 imu(p9, p10, 0xD6, 0x3C); // Accelerometer 00007 //Serial pc(USBTX, USBRX); 00008 00009 int main() { 00010 uLCD.baudrate(3000000); 00011 uLCD.printf("still working"); 00012 imu.begin(); 00013 imu.calibrate(); 00014 uLCD.printf("and working"); 00015 //uLCD.background_color(BLACK); 00016 uLCD.circle(64, 64, 30, WHITE); 00017 int ax = 64, ay = 64, radius = 8; 00018 uLCD.filled_circle(64, 64, radius, WHITE); 00019 while(1) { 00020 imu.readAccel(); 00021 uLCD.current_col = 0; 00022 uLCD.printf("%d ", (int)imu.ax/1000); 00023 uLCD.filled_circle(ax, ay, radius, BLACK); 00024 ax = imu.ax/1000 + 64; 00025 ay = imu.ay/1000 + 64; 00026 uLCD.filled_circle(ax, ay, radius, WHITE); 00027 wait(.1); 00028 } 00029 }
Generated on Mon Aug 22 2022 15:56:00 by
1.7.2