Compare commits

...

5 commits

Author SHA1 Message Date
ChristianSW 1a7b4ce062 const int 2024-03-24 14:40:16 +01:00
ChristianSW f4e3dabe6b minor corr. 2024-03-24 14:35:44 +01:00
ChristianSW 1b381c419c minor corr. 2024-03-24 14:19:46 +01:00
ChristianSW d913fff85e Objekt pneu_servoZ1
Objekt um benannt in pneu_servoZ1, um später mehrere schalten zu können. Serial.println: Zustände Z1
2024-03-24 14:17:15 +01:00
ChristianSW 5b7bacc64f IR pneumatics 2024-03-24 14:07:51 +01:00

56
IR_pneumatics.ino Normal file
View file

@ -0,0 +1,56 @@
#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");
}
}
}