Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »


The electronics component of our build consists of a 12V DC motor, a 12V power supply, an Arduino Uno microcontroller, and an Arduino Motor Shield. The motor shield is mounted onto the microcontroller, and then the components are configured as follows (power supply instead of batteries):


The board controls the motor by running a program when the system is powered. This program writes a constant PWM value to the motor shield as follows:


int directionPin = 12;
int pwmPin = 3;
int brakePin = 9;

void setup() {
  
//define pins
pinMode(directionPin, OUTPUT);
pinMode(pwmPin, OUTPUT);
pinMode(brakePin, OUTPUT);

}

void loop() {
digitalWrite(directionPin, HIGH);
//release breaks
digitalWrite(brakePin, LOW);

//spin the motor
analogWrite(pwmPin, 170);
}
  • No labels