Thanks for infecting me with the MicroPython virus. I've been having fun playing with MicroPython on my ESP32. However, I think a paradigm shift needs to happen in my brain before I could write good Python code instead of just translating C into Python. You're doing a great job introducing me to important Python concepts unavailable to us in C. Thank you!
Nice bite size chunk to take away and chew for a while, I'm impressed at just how "readable" this language is and I think your format is gonna do the trick...they say it takes a couple or three episodes to get into something, well based on your three, I'm in.....cheers!
Thanks Paul, I tried hard to get it shorter, but didn't want to leave any of this content out. Glad to hear you thought it was a good length after all.
I recently switched to an Adafruit micropython board and discovered there is a version of Numpy available for micropython Ulab > Numpy. My non-python boards are basically obsolete now. The great advantage of a pyboard is that no IDE is required. You just edit the main code file on the board directly like it's on a usb dongle.
That is called CircuitPython - Not MicroPython. CircuitPython is forked from MicroPython, sure, but there are fundamental differences with the hardware level syntax, access and functionality. there's also a difference in what's included at a Python level. For instance, CircuitPython doesn't have Thread support. Both are valid versions of "Python for Embedded Hardware" - but it would be wrong to confuse MicroPython and CircuitPython as they are not the same.
With scoping in Python you can read variable from within a child but you can only change it if you use the global keyword. Whereas C or C++ you could change it. So Python makes globals accidental change safe by default. Python also allows you to declare functions inside functions which limits their calling scope. The only thing I miss is the C preprocessor. Small price to pay. The more I use Python the more I like it. Haven't tried it on an ESP yet. I'm sure that will happen.
I like how this series is shaping up. You have a new subscriber! Keep up the great work. It's only a shame you're not using PyCharm to flash a PyBoard D series instead :-)
Looking forward to many more of these MicroPython tutorials. Since you are using an ESP32 will you be including how to access core 0 and core 1 separately. I have seen several "Arduino" based methods for this but cannot find any MicroPython methods.
Using the second core in MP is not currently supported. That said, the second core is enabled in MP and available to FreeRTOS, so C modules in MP can use them.
Great tutorial, im new to python, using it in pi pico and esp32. Ive got an issue extracting numbers from strings. Non of the sample code ive found works. Using import re, and re.findall brings up error object has no attribute findall. Can you do a tutorial on string functions please.
Thank you for this well explained tutorial , I've a question please....i'm receiving a stream of data (String,Integers and float) through a box that contain many sensors, how can i construct a packet that contains all those data ( in a specific order) from the receiving Pin of the ESP32 ? I'll transmit this Packet through wireless connection
If you need it in a specific format and order, you'd put all of the sensor data into a dictionary or list and convert JSON and send it like that so you can unencoded it on the server side and do what you want with it.
You said you needed data for sensors (multiple) with all data in a specific order before sending.Your requirements are super vague, so all I can take from it is that to get the data in a specific order to be sent, it needs to be packed into some container. This really isn't the right forum to asking Q's like this sorry. Maybe join my discord and ask there with a lot more details?
You are 100% correct. In the case of int comparison, it works just like ==, but comparing strings and objects etc with unique id's, it works quite differently. I mentioned during the video I was not going deep in the features I was showcasing, and I'm planning on expanding on stuff like this over time :-)
Hi, Great Viedo. I've tried to compile te Microlad package inside the ESP32 but without success. Can you show us how to compile a micropython library using github files? Thanks a lot
Hey, I noticed that you are interested in MicroPython. We just released a video on MicroPython. Thought you'd want to check it out. Thanks 👇👇👇 utm.io/unoj