I would like to use my Attiny85 as an remote controlled relay switch. I have already tested the sketch on my Atmega328 and it worked. Now I wanted to burn the sketch on my Attiny85 using ArduinoISP but I get the following error in the ArduinoIDE:
sketch_dec25a.ino: In function ‘void setup()’:
sketch_dec25a:13: error: ‘class RCSwitch’ has no member named ‘enableReceive’
sketch_dec25a.ino: In function ‘void loop()’:
sketch_dec25a:20: error: ‘class RCSwitch’ has no member named ‘available’
sketch_dec25a:21: error: ‘class RCSwitch’ has no member named ‘getReceivedValue’
sketch_dec25a:22: error: ‘class RCSwitch’ has no member named ‘getReceivedValue’
sketch_dec25a:25: error: ‘class RCSwitch’ has no member named ‘resetAvailable’
That's my code:
#include <SoftwareSerial.h>
#include <RCSwitch.h>
int RELAY_PIN = 2;
RCSwitch mySwitch = RCSwitch();
SoftwareSerial mySerial(1, 3); // RX, TX
void setup()
{
pinMode(RELAY_PIN, OUTPUT);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
if (mySwitch.available()) {
Serial.println(mySwitch.getReceivedValue());
if(mySwitch.getReceivedValue() == 1234567){
digitalWrite(RELAY_PIN, HIGH);
}
mySwitch.resetAvailable();
}
}
I am using these cores: https://code.google.com/p/arduino-tiny/
I am using the SoftwareSerial just for debugging. Sorry for my bad english and thanks for your help!