21 lines
398 B
C++
21 lines
398 B
C++
const byte IN1 = 6;
|
|
const byte IN2 = 7;
|
|
const byte ENA = 5;
|
|
|
|
void setup() {
|
|
pinMode(IN1, OUTPUT);
|
|
pinMode(IN2, OUTPUT);
|
|
pinMode(ENA, OUTPUT);
|
|
digitalWrite(IN1, HIGH);
|
|
digitalWrite(IN2, LOW);
|
|
Serial.begin(9600);
|
|
}
|
|
|
|
void loop() {
|
|
Serial.println("Begin!");
|
|
analogWrite(ENA, 150);
|
|
delay(1000);
|
|
Serial.println("Stop!");
|
|
analogWrite(ENA, 0);
|
|
delay(1000);
|
|
} |