-
The separate second setWatch() function is missing. See the last
function on that page and take a close look at how the 'times' array
of pulses is sent out through the IR diode by investigating the 'Send
the pulses' comment there.setWatch(function(e) { // stop recording stopWatching(); // Light up LED1 digitalWrite(LED1,1); // Start the 38kHz square wave analogWrite(A5,0.9,{freq:38000}); // Send the pulses digitalPulse(A6, 1, times); // Wait until pulsing is finished digitalPulse(A6, 1, 0); // Turn LED1 off digitalWrite(LED1,0); // start recording again startWatching(); }, BTN, {repeat:true, edge:"rising", debounce:50});
My module also does not have LED1, BTN(please see the screenshot in post 8). Therefore, I asked the question how to adapt this piece of code to my NodeMcu Lua wifi module (https://aliexpress.ru/item/32408097207.html?spm=a2g0s.9042311.0.0.1ad333ed1mlnaz).
Most likely, if possible, then using only this piece of code:
// Start the 38kHz square wave analogWrite(A5,0.9,{freq:38000}); // Send the pulses digitalPulse(A6, 1, times); // Wait until pulsing is finished digitalPulse(A6, 1, 0); // Turn LED1 off
This can only be dealt with after it is clear how to connect the IR diode (post 8)
-
Guys, I am very grateful to you for your help and for the work you have done. I still have problems that I have not found answers from your posts ((.
From the image within the link provided in #5 post, the IR transmit
diode is across Pins A5 and A6. See the third bulleted point that
indicates to connect the shortest leg, the cathode to pin A5 It's
current limiter resistor makes use of the internal pullup.My module does not have contacts A5, A6. I attach the screenshot with the pinout of my module. Can you tell what pins in my module should I connect an IR diode?
Maybe such a connection scheme is suitable?
https://www.google.com/search?q=nodemcu+ir+led&sxsrf=ACYBGNSqNbHslbCiq6V7xUnUov_d_Ug2tQ:1577184026202&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiu_IGtjM7mAhWoyqYKHWYUBEsQ_AUoAXoECAwQAw&biw=1920&bih=937#imgrc=yqz6CjkbPSk1lM: -
-
I don’t understand how to adapt the code https://www.espruino.com/Pico+Infrared from the section "Software - Transmitting" to send an infrared signal to TV
-
-
-
Hello. I have a NodeMcu Lua wifi module(https://aliexpress.ru/item/32408097207.html?spm=a2g0s.9042311.0.0.1ad333ed1mlnaz) + ir diode(https://aliexpress.ru/item/32491780864.html?spm=a2g0s.9042311.0.0.264d33edJE2Wsr). I have successfully read the codes and the TV remote control(http://www.espruino.com/Pico+Infrared). How can I control the IR diode to send a signal to the TV?
It is very sad that I spent so much time studying the documentation and writing other espruino libraries for my personal project (smart home system), and now I have to abandon the use of espruino at all because I see no reason to continue without this part ((. Your modules are very expensive, that is, almost comparable in price to raspberry pi which has much wider possibilities.I understand that you do not want to support other modules for free, and I do not blame you, but it is advisable to immediately inform people about this fact so as not to waste not your time on me or other people. I thank you anyway for your help. Thank you.