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
paddle.h
00001 #include "uLCD_4DGL.h" 00002 00003 class Paddle 00004 { 00005 public: 00006 // Constructors 00007 Paddle(uint8_t, uint8_t, uint8_t, uint8_t); 00008 // Set Functions 00009 void setLimits(uint8_t, uint8_t); // left and right limits of the paddle 00010 void setMaxMove(uint8_t); 00011 // Paddle location functions 00012 uint8_t getX(); 00013 void setX(uint8_t); 00014 // Member Functions 00015 void move(float); // false means move left, true means move right 00016 bool checkHit(uint8_t, uint8_t, uint8_t); // Using a position and size, checks to see if something has hit the paddle 00017 double returnAngle(double, double); // Using a ball x position, gives a return vx and vxDir 00018 bool returnDir(uint8_t, uint8_t); 00019 void reset(uint8_t, uint8_t); 00020 00021 private: 00022 // Data members are suggestions, feel free to add/remove 00023 uint8_t x; 00024 uint8_t y; 00025 uint8_t length; 00026 uint8_t width; 00027 uint8_t maxMove; 00028 uint8_t leftLim; 00029 uint8_t rightLim; 00030 bool bottom; //0 is top, 1 is bottom 00031 }; 00032
Generated on Fri Jul 15 2022 08:13:00 by
