I have bought
https://www.jaycar.us/arduino-compatibl ... e/p/XC4426
And want to run it on a ESP wroom 32
I am very new to all this but come from an IT background. I used the code below and cannot see the IR working with a digital phone which does show when I use a remote.
Code: Select all
int IRledPin = 17;
void setup() {
pinMode(IRledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
delay(2000);
SendNikonCode();
Serial.println("Sending IR signal");
delay(300);
}
void pulseIR(long microsecs) {
cli();
while (microsecs > 0) {
digitalWrite(IRledPin, HIGH);
delayMicroseconds(10);
digitalWrite(IRledPin, LOW);
delayMicroseconds(10);
microsecs -= 26;
}
sei();
}
void SendNikonCode() {
pulseIR(2080);
delay(27);
pulseIR(440);
delayMicroseconds(1500);
pulseIR(460);
delayMicroseconds(3440);
pulseIR(480);
delay(65);
pulseIR(2000);
delay(27);
pulseIR(440);
delayMicroseconds(1500);
pulseIR(460);
delayMicroseconds(3440);
pulseIR(480);
}
- is this the easiest way to test id the transmitter works?
- esp32 talks about IR, is there an on board IR
- is there a code sample for this
- what library should I use to get an IR transmitter to work
I assumed the middle pin is for the 5v as this was the case with the receiver. I does not show on the pinout but adding this to check I have not blown the transmitter.
I have got the receiver working so I am not a complete idiot but please be gentle with me.
Thanks all,
Iain