Compare commits
5 commits
pneumatics
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
1a7b4ce062 | ||
|
f4e3dabe6b | ||
|
1b381c419c | ||
|
d913fff85e | ||
|
5b7bacc64f |
56
IR_pneumatics.ino
Normal file
56
IR_pneumatics.ino
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue