Test

Dependencies:   mbed 4DGL-uLCD-SE PinDetect

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "uLCD_4DGL.h"
00003 #include "LSM9DS1.h"
00004 
00005 
00006 uLCD_4DGL uLCD(p13, p14, p12);
00007 
00008 Serial pc(USBTX,USBRX);
00009 
00010 LSM9DS1 imu(p9, p10, 0xD6, 0x3C);
00011 
00012 
00013 int main() {
00014 
00015     // Center Location
00016     int start_x_pos = 130 / 2;
00017     int start_y_pos = 130 /2;
00018     
00019     imu.calibrate();
00020     
00021     
00022     // Starting Location
00023     int x_pos = imu.gx;
00024     int y_pos = imu.gy;
00025     
00026     // Draw big circle
00027     uLCD.circle(start_x_pos, start_y_pos, start_x_pos, GREEN);
00028     
00029     
00030     uLCD.circle(start_x_pos, start_y_pos, 8, GREEN);
00031     // Draw small filled circle
00032     uLCD.filled_circle(x_pos, y_pos, 8, RED);
00033     
00034 }
00035 
00036 
00037 
00038 
00039 
00040