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 PinDetect mbed SparkfunAnalogJoystick mbed-rtos
Fork of ECE2036Lab2StarterCode by
ball.h
00001 #include "uLCD_4DGL.h" 00002 00003 class Ball 00004 { 00005 public: 00006 Ball (uint8_t, uint8_t, uint8_t); 00007 // Set Functions 00008 void setVx(double); // This sets the velocity 00009 void setVxDir(bool); 00010 void setVy(double); // This sets the velocity 00011 void setVyDir(bool); 00012 // Get Functions 00013 uint8_t getSize(); 00014 uint8_t getX(); 00015 uint8_t getY(); 00016 uint8_t getFutureX(); // get estimate of where the ball will be in the next update() 00017 uint8_t getFutureY(); // get estimate of where the ball will be in the next update() 00018 // Member Functions 00019 void reverseXDirection(); // negate the sign for when a ball hits something 00020 void reverseYDirection(); // negate the sign for when a ball hits something 00021 void reset(uint8_t, uint8_t, int, int); // takes in a new location and new directions and draws the starting point for the ball 00022 void update(); // moves the ball on the screen one vx and vy 00023 00024 private: 00025 double vx; 00026 bool vxDir; //false is left (-x), true is right (+x) 00027 double vy; 00028 bool vyDir; //false is up (-y), true is down (+y) 00029 double x; 00030 double y; 00031 uint8_t diameter; 00032 };
Generated on Fri Jul 15 2022 08:13:00 by
