Seems it doesn't work with some remotes, i.e. I have a remote for garage gate ANMotors, that has 12 bits of preamble and 65 bits of code, usually I thend it like this:
int Pe = 413;
int Pe2 = Pe*2;
void SendANMotors(long c1, long c2) // c1 = 0x20247878, c2 = 0x150bce89
{
noInterrupts();
for (int j = 0; j < 4; j++)
{
for (int i = 0; i < 12; i++) {
delayMicroseconds(Pe);
digitalWrite(txPin, HIGH);
delayMicroseconds(Pe);
digitalWrite(txPin, LOW);
}
delayMicroseconds(Pe * 10);
for (int i = 4 * 8; i > 0; i--) {
SendBit(bitRead(c1, i - 1));
}
for (int i = 4 * 8; i > 0; i--) {
SendBit(bitRead(c2, i - 1));
}
SendBit(1);
SendBit(1);
delayMicroseconds(Pe * 39);
}
interrupts();
}
void SendBit(byte b) {
if (b == 0) {
digitalWrite(txPin, HIGH); // 0
delayMicroseconds(Pe2);
digitalWrite(txPin, LOW);
delayMicroseconds(Pe);
}
else {
digitalWrite(txPin, HIGH); // 1
delayMicroseconds(Pe);
digitalWrite(txPin, LOW);
delayMicroseconds(Pe2);
}
}
Seems it doesn't work with some remotes, i.e. I have a remote for garage gate ANMotors, that has 12 bits of preamble and 65 bits of code, usually I thend it like this:
could you please add this protocol?