Erste Augenbrauen Probe

main
HollowPurity 2023-07-19 14:22:32 +02:00
parent 064817a8d0
commit ba7708866f
1 changed files with 56 additions and 0 deletions

56
servo.ino 100644
View File

@ -0,0 +1,56 @@
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 28 May 2015
by Michael C. Miller
modified 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo linkeAugenbraue;
Servo rechteAugenbraue; // create servo object to control a servo
// twelve servo objects can be created on most boards
void setup() {
myservo.rechteAugenbraue(D1);
myservo.linkeAugenbraue(D4); // attaches the servo on GIO2 to the servo object
pinMode(D2, INPUT_PULLUP);
pinMode(D3, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
if (istTasterGedrueckt(D2)) {
linkeAugenbraue.write(90);
rechteAugenbraue.write(90);
Serial.writeln("Vorwärts");
}
if (istTasterGedrueckt(D3)) {
linkeAugenbraue.write(0);
rechteAugenbraue.write(0);
Serial.writeln("Rückwärts");
}
debug();
}
void debug(){
Serial.write("Spannung auf linker Augenbraue: ")
Serial.writeln(D4);
Serial.write("Spannung auf rechter Augenbraue: ")
Serial.writeln(D1);
delay(200);
}
bool istTasterGedrueckt(int taster) {
return digitalRead(taster) == LOW;
}