Use the digistump for servo control.

Planned to connect to my desk lamp but
I didn't finsh this one yet.
This commit is contained in:
Joe Tretter
2022-03-29 18:05:57 -05:00
commit 31687fb7fc
7 changed files with 150 additions and 0 deletions

24
src/main.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <Arduino.h>
#include <SimpleServo.h>
SimpleServo servo1;
void setup() {
servo1.attach(1); // !! This cost me hours, because I thought it's 6, but that's the physical pin..
}
void loop() {
for(int posDegrees = 0; posDegrees <= 180; posDegrees++) {
servo1.write(posDegrees);
Serial.println(posDegrees);
delay(20);
}
for(int posDegrees = 180; posDegrees >= 0; posDegrees--) {
servo1.write(posDegrees);
Serial.println(posDegrees);
delay(20);
}
}