Skip to content

Controlador del motor de dirección

Juan Eduardo edited this page Sep 2, 2019 · 1 revision

Cytron 30A Bi-directional DC Motor Driver

Wiring Diagram

Teensy 3.2 code

int DIRPin = 14;
int PWMPin = 20;

void setup() {  

    pinMode(DIRPin, OUTPUT);  // Set digital pin 14 as an output.
}

void loop() {
    digitalWrite(DIRPin, HIGH);  // Set the rotation direction.
    analogWrite(PWMPin, 50);   // Turn the motor on at half speed for one second.
    delay(1000);  
    analogWrite(PWMPin, 0);      // Turn the motor off for one second.  
    delay(1000);
    digitalWrite(DIRPin, LOW);  // Reverse the rotation direction.
    analogWrite(PWMPin, 50);   // Turn the motor on at half speed for one second.
    delay(1000);  
    analogWrite(PWMPin, 0);   // Turn the motor off for one second.
    delay(1000);
}

Steer angle sensor

Wiring Diagram

Teensy 3.2 code

Teensy Analog Tutorial

void setup()
{                
  Serial.begin(38400);
}

int val;

void loop()                     
{
  val = analogRead(21);
  Serial.print("analog 0 is: ");
  Serial.println(val);
  delay(250);
}
Clone this wiki locally