I am researching on micropython to use for an IoT project for school using nodeMCU esp8266. one of the use cases requires the device to receive IR signal from an Aircon remote control and save it as well as being able to transmit this code using and IR LED. in circuitpython there is a library called pulseio that can do this function, but it is not available in micropython. can this library be imported into micropython?
Asked
Active
Viewed 1,274 times
3
-
3The only real way to answer this question is to try it. There are minor differences between CircuitPython and MicroPython, but a great deal of code will run fine in either environment. Just try it and see what happens. If it fails, come back here and include specific error messages in your question and we'll see if we can help out. – larsks Jan 05 '20 at 13:54
-
What hardware are you planning to use for the IR TX/RX? There are cheap modules available that send and receive standard IR protocols via a UART interface, see [here](https://github.com/mcauser/micropython-ys-irtm) for example - I think all the code there should work on the ESP8266 given the right pin numbers etc. – nekomatic Jan 06 '20 at 13:51
-
Alternatively you can [run older versions of CircuitPython on the ESP8266](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266), which should work as long as the library doesn't depend on any newer features. You could also try asking on the [CircuitPython](https://forums.adafruit.com/viewforum.php?f=60) and/or [MicroPython](https://forum.micropython.org/) forums - there has been some discussion of IR on MicroPython from time to time if you search. – nekomatic Jan 06 '20 at 13:55
1 Answers
4
In short No.
It is very unlikely any CircuitPython library willl work straight over in MicroPython on your board. The main reason for this is that once the library starts to use UART or I2C the underlying implementation in CircuitPython is very dependent on other CircuitPython libraries which do not have equivalents in MicroPython.
It may be possible to find all these and re-implement them using standard MicroPython.
The decision point is if you can do that faster than finding a MicroPython library or example for your board to do the same thing OR if you should buy a CircuitPython compatible board instead.

Patrick
- 2,044
- 1
- 25
- 44