Microcontrollers are wonderfully useful things, but programming them can be a little daunting if you’re used to the simplicity of compiling for regular PCs. Over time though, this has become easier. Communities have strayed away from assembly code and created higher-level languages such as Micropython, to allow these devices to be programmed in a more accessible manner. Unfortunately, Micropython has historically lacked a decent high-level GUI library. Thankfully, that’s no longer the case, with [amirgon] porting LittlevGL to the platform.
Putting a GUI into a project with a screen seems simple, until one actually gets down to brass tacks. A simple button can consist of a background color, text, and a symbol – and that’s not even considering the use of shading or other visual effects. Having a library to handle the grunt work can massively cut down development time.
[...] There are other approaches to this problem, too – with MyOpenLab being a particularly versatile example.
(Score: 0) by Anonymous Coward on Monday March 04 2019, @05:53PM (7 children)
It's twice the size of elua [eluaproject.net] with tables, pattern matching and a clean C API. Why would anybody use a microcontroller in place of a SBC if you're intending to code primarily in an interpreted language?
(Score: 2) by janrinok on Monday March 04 2019, @06:21PM (3 children)
I use a small microcontroller board that is provided by Pycom (Lopy4 [pycom.io]). Read the specification [pycom.io]. I can program it in MicroPython, Lua or other languages. The cost is €34.00. Please tell me of the SBC that can match that specification for the same price or less.
(Score: 0) by Anonymous Coward on Monday March 04 2019, @07:51PM (2 children)
Raspberry Pi 3 A+ [ebay.com]
(Score: 2) by janrinok on Monday March 04 2019, @08:07PM (1 child)
The Raspberry Pi does NOT have LoRa nor SigFox built in, nor does it have most of the specification that I linked to. The WiFi and BLE are significantly less capable. It doesn't have a sleep mode which requires only 25 microamperes but is still capable of responding to interrupts from the GPIO pins. It is possible to run the LoPy4 on lithium batteries for weeks or months without needing recharging. You have read the spec, haven't you? The Raspberry Pi, of which I have 11 at present, is nothing like the same device.
(Score: 0) by Anonymous Coward on Monday March 04 2019, @11:03PM
Never heard of SigFox and I never claimed anything about power consumption which doesn't seem as relevant if you're scripting a UI with python as it would for a datalogger.
Do that on an Arduino nano if you bypass the voltage regulator and you can pick them up for $2 each. Depends on your use case.
Not in depth just skimmed over stuff like Wi-fi and bluetooth. I typically have little use for these on microcontrollers but if I did want something more advanced than a little OLED, I'd employ networking to run the GUI on a phone, tablet or SBC.
(Score: 2) by janrinok on Monday March 04 2019, @06:52PM (2 children)
You are, I think, confusing MicroPython with Python. MicroPython also runs on bare metal in exactly the same way as eLua. If all you are arguing about is the choice of language then that is surely a matter of personal preference assuming that both have the same choice of libraries for the various functions (GPS, LoRa or whatever).
http://micropython.org/ [micropython.org]:
'Interpreted'? - I think not.
(Score: 0) by Anonymous Coward on Monday March 04 2019, @11:17PM (1 child)
I've not worked with lua for about 15 years but it was designed to be small and embeddible. I mentioned it in response to your C comment because you get strings, tables, pattern matching and a simple C API. With eLua, I do know you can build without the parser (etc) to reduce binary size. Size seems to be my preference when writing embedded code.
It is a bytecode interpreter is it not ;P
(Score: 2) by janrinok on Tuesday March 05 2019, @08:20AM
From http://micropython.org/ [micropython.org]
However you asked:
No. it appears not....