SunFounder GalaxyRVR Kit for Arduino, Release 1.0
3.5.2 Materials needed
• SunFounder R3 Board
• TT Motors
• GalaxyRVR Shield
• Battery
• Mars Rover Model (Equipped with Rocker-Bogie System)
• Basic tools and accessories (e.g. screwdriver, screws, etc.)
• USB Cable
• Arduino IDE
• Computer
3.5.3 Steps
Step 1: Assembling the Rover Components
In this step, we will assemble the battery, R3 board, GalaxyRVR Shield, motors, and wheels onto the pre-assembled
rocker-bogie system. This will bring the GalaxyRVR to a runnable state.
Congratulations! We’ve successfully built our very own rover, and it’s ready to start exploring. Let’s get moving!
Step 2: Set the Rover in Motion
Now it’s time to breathe life into our creation and send it off on its maiden voyage. But how do we communicate with
our rover? How do we tell it where to go and what to do? That’s where our coding skills come into play!
In the real world, if we want a car to move forward, we push the accelerator, and both wheels start spinning. The wheels
on the right side turn clockwise, while those on the left side turn counterclockwise.
Imagine you’re sitting in the driver’s seat, the world whizzing past you as you cruise along the open road - that’s exactly
the experience we’re going to give our rover.
Now, let’s translate that experience into the language our rover understands - code!
#include <SoftPWM.h>
// Define the pins of motors
const int in1 = 2;
const int in2 = 3;
const int in3 = 4;
const int in4 = 5;
void setup() {
// Initialize SoftPWM
SoftPWMBegin();
}
void loop() {
// Set the left motors rotate counterclockwise
SoftPWMSet(in1, 255); // Full speed
(continues on next page)
3.5. Lesson 5: Unleashing Mars Rover Mobility 47