Compare commits
No commits in common. "main" and "pneumatics" have entirely different histories.
main
...
pneumatics
|
@ -1,56 +0,0 @@
|
|||
#include <IRremote.h>
|
||||
#include <Servo.h>
|
||||
|
||||
// 1 = 69;
|
||||
// 2 = 70;
|
||||
// 3 = 71;
|
||||
// 4 = 68;
|
||||
// 5 = 64;
|
||||
// 6 = 67;
|
||||
// 7 = 7;
|
||||
// 8 = 21;
|
||||
// 9 = 9;
|
||||
// 0 = 25;
|
||||
// Asterisk = 22;
|
||||
// Rhombus = 13;
|
||||
// OK = 28;
|
||||
// Up = 24;
|
||||
// Down = 82;
|
||||
// Left = 8;
|
||||
// Right = 90;
|
||||
|
||||
const int IR_pin = 11;
|
||||
int IrWert = 0;
|
||||
|
||||
const int Z1_pin = 9;
|
||||
Servo pneu_servoZ1;
|
||||
|
||||
void setup() {
|
||||
IrReceiver.begin(IR_pin);
|
||||
pneu_servoZ1.attach(Z1_pin);
|
||||
pneu_servoZ1.write(50);
|
||||
Serial.begin(9600);
|
||||
Serial.println("verbunden");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (IrReceiver.decode()) {
|
||||
IrReceiver.resume();
|
||||
IrWert = IrReceiver.decodedIRData.command;
|
||||
if (IrWert == 24) {
|
||||
pneu_servoZ1.write(35);
|
||||
delay(500);
|
||||
Serial.println("Z1 aus");
|
||||
}
|
||||
if (IrWert == 28) {
|
||||
pneu_servoZ1.write(50);
|
||||
delay(500);
|
||||
Serial.println("Z1 gesperrt");
|
||||
}
|
||||
if (IrWert == 82) {
|
||||
pneu_servoZ1.write(60);
|
||||
delay(500);
|
||||
Serial.println("Z1 ein");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue