IR LED seems to be always on, even freshly after a reboot
frank26080115 last edited by
I am using UIFlow v1.9.7
This is weird. Point your phone's camera at the IR LED of a M5Stick or M5Stack that has the IR LED. Even just after a reboot, it seems to be glowing.
I cannot use the built-in "ir" object because it implements NEC protocol, which is not what I need. I need to generate a 40KHz pulse train for SIRC protocol
Taking manual control over the LED by deinitializing the RMT, I can turn off the pin using machine.Pin
But after reinitializing RMT module, the LED starts to glow again.
I am trying code that looks like
>>> rmt.loop(True) >>> rmt.write_pulses([1, 100000], start=0) # this should make the LED dim
>>> rmt.loop(True) >>> rmt.write_pulses([1, 100000], start=1) # this should make the LED bright
The weird thing is that one of these should make the LED appear off, or at least dim. The opposite snippet should make the LED appear very bright. This is not the case. I see no change in brightness
What am I doing wrong?
Has anybody successfully used the IR LED for anything? The MicroPython version implemented in UIFlow is extremely old and won't match the latest documentation, the best documentation is actually this particular commit in the official ESP32 port of MicroPython https://github.com/micropython/micropython/blob/1678f417445703750e187b1b8a83c8c3e0e3796f/ports/esp32/esp32_rmt.c
oh and in case anybody needs to know, to deinitialize the RMT because you can't use the settings M5Stack is forcing upon you, I'm using this
try: ir.__dict__['_tx_encode']._rmt.deinit() del ir.__dict__['_tx_encode']._rmt del ir except: pass
felmue last edited by
this seems to be an issue from UIFlow firmware 1.9.x and later. UIFlow 1.7.5 doesn't light up the IR LED just after reboot. It's probably the same issue as reported here.
digital write pin 9to
1turns the IR LED off. It seems that it might be inverted?