summaryrefslogtreecommitdiff
path: root/Origin/user-code/dcmotor/arduino/dcmotor-clock/dcmotor-clock.ino
blob: 2b8c3858c91ea9bb6f5883eff8b2ad32bce3f8f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
void setup() {
Serial.begin(115200); // set the baudrate
pinMode(9, OUTPUT);  // use pins 9 and 10 for motor output
pinMode(10, OUTPUT);
analogWrite(9, 100); // PWM 100 on pin 9 makes the motor rotate
analogWrite(10, 0); 
delay(3000);        // This is allowed to continue for 3 seconds 
analogWrite(9, 0);   // 0 on pin 9 stops the motor
analogWrite(10, 0);
}
void loop() {
// what is put here will run in an infinite loop
}