/*
SendDemo - sends RF codes using ATtiny.
VCC : 3.3V
GND : GND
Data : outPin
ANT : in between the two headers!
*/
#include <RCSwitch.h> //
https://github.com/sui77/rc-switch
RCSwitch mySwitch = RCSwitch();
#if defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
#define outPin 10 // PA0
#elif defined(__AVR_ATtiny85__)
#define outPin 3 // PB3
#elif defined(__AVR_ATtiny461__) ||
defined(__AVR_ATtiny861__)
#define outPin 12 // PA6
#elif defined(__AVR_ATtiny4313__)
#define outPin 8 // PA1
#endif
void setup() {
Serial.begin(9600);
pinMode(outPin, OUTPUT);
mySwitch.enableTransmit(outPin);
}
void loop() {
static long value=0;
// mySwitch.send(value, 24);
mySwitch.send(value, 32);
value++;
delay(1000);
} |