SunFounder GalaxyRVR Kit for Arduino, Release 1.0
Let’s learn how these two drive chips control the six motors through hands-on experience:
• 1. Connecting the Circuit
1. Plug the GalaxyRVR Shield into the R3 board, connect a motor, and finally plug in the battery to provide
power to the expansion board.
2. When first used or when the battery cable is unplugged, the GalaxyRVR Shield activates its over-discharge
protection circuitry. You’ll need to plug in the Type-C cable for about 5 seconds to release the protection. If
the power indicator lights up, it means the protection status has been released. Check the battery indicators
at this point - if both are off, keep the Type-C cable plugged in to charge the battery.
• 2. Writing and Uploading Code
1. Open the Arduino IDE and input the following code:
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}
void loop() {
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
}
– pinMode(): This function sets a pin as INPUT or OUTPUT, akin to deciding whether a
38 Chapter 3. Course Mode