fixed Syntax mistakes
parent
ba7708866f
commit
c7de871279
20
servo.ino
20
servo.ino
|
@ -19,8 +19,8 @@ Servo rechteAugenbraue; // create servo object to control a servo
|
|||
|
||||
|
||||
void setup() {
|
||||
myservo.rechteAugenbraue(D1);
|
||||
myservo.linkeAugenbraue(D4); // attaches the servo on GIO2 to the servo object
|
||||
rechteAugenbraue.attach(D1);
|
||||
linkeAugenbraue.attach(D4); // attaches the servo on GIO2 to the servo object
|
||||
pinMode(D2, INPUT_PULLUP);
|
||||
pinMode(D3, INPUT_PULLUP);
|
||||
|
||||
|
@ -31,22 +31,24 @@ void loop() {
|
|||
if (istTasterGedrueckt(D2)) {
|
||||
linkeAugenbraue.write(90);
|
||||
rechteAugenbraue.write(90);
|
||||
Serial.writeln("Vorwärts");
|
||||
Serial.println("Vorwärts");
|
||||
debug();
|
||||
}
|
||||
if (istTasterGedrueckt(D3)) {
|
||||
linkeAugenbraue.write(0);
|
||||
rechteAugenbraue.write(0);
|
||||
Serial.writeln("Rückwärts");
|
||||
Serial.println("Rückwärts");
|
||||
debug();
|
||||
}
|
||||
|
||||
debug();
|
||||
//debug();
|
||||
|
||||
}
|
||||
void debug(){
|
||||
Serial.write("Spannung auf linker Augenbraue: ")
|
||||
Serial.writeln(D4);
|
||||
Serial.write("Spannung auf rechter Augenbraue: ")
|
||||
Serial.writeln(D1);
|
||||
Serial.write("Spannung auf linker Augenbraue: ");
|
||||
Serial.println(D4);
|
||||
Serial.write("Spannung auf rechter Augenbraue: ");
|
||||
Serial.println(D1);
|
||||
delay(200);
|
||||
}
|
||||
bool istTasterGedrueckt(int taster) {
|
||||
|
|
Loading…
Reference in New Issue