An Arduino library for use in Triam Udom Suksa School's robotics club
To import this library or any library into the Arduino IDE, follow these simple steps:
First, download the files
- Unzip the downloaded .zip File
- Copy the unzipped folder and navigate to
Documents/Arduino/libraries
and paste it there. Rember to paste the FOLDER, the not FILES inside of it
To update, do these exact same steps and replace the old ClubRobot
folder
And you're done! Now write #include <ClubRobot.h>
on the top of your Arduino Sketch (code) and call robotInit();
in void setup()
and it should work!
The following is a list of how the Arduino should be connected to the DRV8833 motor driver
- IN1 -> digital 3
- IN2 -> digital 5
- IN3 -> digital 6
- IN4 -> digital 9
All of the following are void functions
robotInit()
sets up pinModeforward(int val)
makes both wheels spin in the forward direction at the speed given by the specified valuebackward(int val)
makes both wheels spin in the backward direction at the speed given by the specified valueleftForward(int val)
makes the left wheel spin in the forward direction at the speed given by the specified valuerightForward(int val)
makes the right wheel spin in the forward direction at the speed given by the specified valuemotorStop()
makes both wheels stop rotatingleftStop()
makes the left wheel stop rotatingrightStop()
makes the right wheel stop rotating