![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Part 1 should work correctly if all of part 2 and sd card junk is commented out. Attempted to update the libraries multiple times but could not get code to compile. the error "overload function" kept appearing.
Dependencies: 4DGL-uLCD-SE MMA8452Q SDFileSystem bouncing_ball mbed
Fork of OCE360_4 by
main.cpp
- Committer:
- slicht
- Date:
- 2017-10-24
- Revision:
- 1:6b99ffa62cc8
- Parent:
- 0:8d3812068c6c
- Child:
- 2:552e6feb8709
File content as of revision 1:6b99ffa62cc8:
// Demo for the uLCD-144-G2 and MMA8452Q 3-axis accelerometer #include "mbed.h" #include "MMA8452Q.h" #include "uLCD_4DGL.h" #include "bouncing_ball.h" #define INIT_RADIUS 10 #define INIT_COLOR 1 //#include "bouncing_ball.h" // Graphic LCD - TX, RX, and RES pins uLCD_4DGL uLCD(p9,p10,p11); // Accelerometer - SDA, SCL, and I2C address MMA8452Q accel(p28, p27, 0x1D); physics_ball ball1(INIT_COLOR,INIT_RADIUS); int main() { // Initialize uLCD uLCD.baudrate(115200); uLCD.background_color(BLACK); uLCD.cls(); // Initialize accelerometer accel.init(); //Initiailize ball // Make a ball "fall" in direction of accelerometer while (1) { // Draw a red circle uLCD.filled_circle((int)ball1.posx, (int)ball1.posy, ball1.radius, RED); // Wait before erasing old circle wait(0.02); // In seconds // Erase old circle uLCD.filled_circle((int)ball1.posx, (int)ball1.posy, ball1.radius, BLACK); } }