Hallo
Ich möchte eine kleine Box bauen, welche auf das Signal einer
gewöhnlichen IR Fernbedienung reagiert und dann eine Funksteckdose
schaltet. Das Ganze funktioniert einwandfrei mit einem Arduino Uno. Nun
möchte ich eine Platine herstellen. Da ich eigentlich nur zwei Pins
benötige, dachte ich, dass ich einen Attiny 85 nutzen könnte. Dieser hat
aber nur 8Kb Flash Speicher. Mein Code hat rund 11Kb. Ich wollte fragen,
ob jemand eine Idee hat, um den Code zu verkleinern, dass er auf einen
Attiny 85 passt.
Hier der Code:
1 | #include <RCSwitch.h>
|
2 |
|
3 | #include <IRremote.h>
|
4 |
|
5 | int RECV_PIN = 11;
|
6 |
|
7 | IRrecv irrecv(RECV_PIN);
|
8 |
|
9 | decode_results results;
|
10 | RCSwitch mySwitch = RCSwitch();
|
11 |
|
12 | void setup() {
|
13 | Serial.begin(9600);
|
14 | mySwitch.enableTransmit(10);
|
15 | irrecv.enableIRIn();
|
16 | }
|
17 |
|
18 | void loop() {
|
19 | if (irrecv.decode(&results)) {
|
20 | /*if(results.value==0xF21169DD||results.value==0xC5F4A8B0){
|
21 | mySwitch.send(5308436, 24);
|
22 | }
|
23 | if(results.value==0x95C6EAD7||results.value==0x8A353E12){
|
24 | mySwitch.send(5308437, 24);
|
25 | }*/
|
26 | if(results.value==0xC708F){
|
27 | mySwitch.send(5308436, 24);
|
28 | }
|
29 | if(results.value==0xCB04F){
|
30 | mySwitch.send(5308437, 24);
|
31 | }
|
32 | irrecv.resume(); // Receive the next value
|
33 | }
|
34 |
|
35 | }
|
Bitte um Hilfe