i need a alternative for send a code for RF433Mhz Transmitter with the new Attiny 1 series 414 / 814. Because the RCswitch library not work on 1 Series Attiny. I found an rip single protocol for one code in the RCswitch library.
{ 650, { 1, 10 }, { 1, 2 }, { 2, 1 }, false }, // protocol 2
but i need
{ 365, { 18, 1 }, { 3, 1 }, { 1, 3 }, true }, // protocol 10
my question what should be able to modify to true ?
norbert
#define tx_pin 9
#define repeat 5
#define pulselength 650 //protocol 2
void setup() {
pinMode(tx_pin, OUTPUT);
}
void loop() {
send(4856399, 24);
delay(2000);
}
void send(unsigned long code, byte length) {
for (int nRepeat = 0; nRepeat < repeat; nRepeat++) {
for (char i = length - 1; i >= 0; i--) {
if (code & (1L << i))
transmit(2, 1);
else
transmit(1, 2);
}
transmit(1, 10);
}
digitalWrite(tx_pin, LOW);
}
void delay_pulselengths(uint16_t us)
{
while (us > 0)
{
delayMicroseconds(pulselength);
us--;
}
}
void transmit(byte high, byte low) {
digitalWrite(tx_pin, HIGH);
delay_pulselengths(high);
digitalWrite(tx_pin, LOW);
delay_pulselengths(low);
}