BotballHacks was designed for the intent of ease of calibration and use of botball. The code provides a simple and non-convoluted method of calibrating the botball, and provide simple movement functions for all your botball needs. This was orginally designed in 2019 by Harrison with his unreadable code and mathematics.
- Simple, non-convoluted method of calibration.
- Asymmetric calibration for uneven cars.
- Basic movement function
moveCentimeters(),rotate(), and more. - Automatic Calibration (Coming soon...)
Note: This is a work in progress at the moment better method coming soon
- Copy and paste the code into your code
- Calibrate your robot by adjusting the calibration constant need. For help you can find the calibration tutorial here.
// Calibration constants
#define leftMotor 1
#define rightMotor 0
#define wheelDistance 1.0 // distance between from wheel to wheel
#define leftMotorWeight 1.0 // adjust until it travels 1 cm/s straight when at 1 velIRL
#define rightMotorWeight 1.0
#define maxVelIRL 10.0 // compute by taking 1000 and dividing it by the maximum of leftMotorWeight or rightMotorWeight- After calibrating, your done! You can start using it for your botball needs.
Here is a list of all the basic movement functions provided by BotballHacks.
void moveCentimeter(double cm)moveCentimeter() moves the botball cm centimeters at maximum speed.
void rotate(double deg)rotate() rotates the botball deg degrees anti-clockwise at maximum speed. For clockwise rotations input a negative value for deg.
void moveCentimeterAtSpeed(double cm, double velIRL)moveCentimeter() moves the botball cm centimeters at velIRL speed.
void motorBoth(double velIRL)moveCentimeter() moves the both wheel at velIRL speed.