4 ms·
A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction. At the point you can use a higher leve
by iostream24 4y ago
A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction. At the point you can use a higher level interaction, why stop at Python? Go full codeless checkboxes on webpages.
If the alleged problem that micropython solves is complexity of actually coding microcontrollers, why settle for Python, which can only ever wrap/call native functionality that is hidden like a black box?
Is this really easy or useful at all?
A superior solution already exists called “Arduino” that removes most of the complexity of microcontroller development, comes with an ide and loader tool chain and you press a button and Bingo, your code is running directly on the metal of a variety of hardware, which these days includes some of the most powerful microcontrollers out there such as the teensy 4 and its iMX RT1062
I have an archmix with the identical microcontroller, but with a micropython runtime, it was sold by seeed studio and it sits in the box it came in as I never managed to do much with it.
There’s really no effective way of avoiding hardware with microcontrollers, as you expressly access it’s features with no operating system and only a HAL or CMSIS for an API, most of the time.
By the time someone wraps all hardware functionality in a scripting language, much developer time has passed and it’s likely that features are missing or broken, and basically the noobs are still out of luck waiting for all promised supported functionality and discouraged from learning anything about the actual hardware platform
- KaiserPro 4y ago> A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction I mean its almost irrelevant to the ability to handle serial, unless you are exec'ing raw serial, which is going to make everyone sad. I have found that bitbanging in python a bit of an arse. Using the struct library isn't as forgiving (or dangerous) as it is in C. But on the flip side it does force you to properly define your binary serial protocol, unless you want loads of exceptions. Arduino is grand, and fun. But where the python like languages shine is higher level stuff, like networking.
- mkl 4y ago> A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction. This is a nonsensical nonsequitur. The whitespace of the language you use has nothing to do with what communication it can do. Python works great for talking to my plotter over RS232.
- Sohcahtoa82 4y ago> A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction. Whenever I see someone complaining about Python's use of whitespace as syntax, I think to myself "This person poorly formats their code". If you're properly formatting code, there's no reason to complain about it. You might occasionally copy/paste code from where that doesn't properly encode the whitespace, in which case yeah it might get messed up, but that's rare in my experience.