Skip to main content

Micropython and C Play Together Better

Python is a versatile, powerful language but sometimes it’s not the best choice, especially if you’re doing work in embedded systems with limited memory. Sometimes you can get away with MicroPython for these cases, but the best language is likely C or assembly. If you’re really stubborn, like [amirgon], and really want C and Python to play well together, you can make use of his new tool which can bring any C library to MicroPython.

As an example of how this tool is used, a “Pure MicroPython” display driver for ILI9341 on the ESP32, which means that everything was implemented in MicroPython. [amirgon] wanted to see how the Python driver would compare to one that’s already been written in C, and use it to showcase MicroPython binding. This tool also automatically converts structs, unions, enums and arrays to Python objects, and provides a means to work with pointers which is something that Python doesn’t handle in the same way that C requires.

[amirgon] hopes that this tool will encourage the adoption of Micropython by removing the obstacle of missing APIs and libraries in MicroPython. Since most libraries for systems like these are written in C, a way to implement them in Python is certainly powerful. We featured one use case for this a while back, but this is a much more generic fix for this coding obstacle.

Image via [Frank Stajano]

 



from Hackaday https://ift.tt/30NRvwg

Comments

Popular posts from this blog

Bill Gates steps down from Microsoft’s board to focus on philanthropy

In an announcement on Friday, Microsoft revealed that company co-founder Bill Gates has decided to step down from his role on its Board of Directors in order to focus on his philanthropic efforts at the Bill & Melinda Gates Foundation. This is Gate’s biggest change to his role at Microsoft since stepping down as company chairman in February 2014. According … Continue reading from SlashGear https://ift.tt/2We90Gu

World Economic Forum launches Global AI Council to address governance gaps

The World Economic Forum is creating a series of councils that create policy recommendations for use of things like AI, blockchain, and precision medicine. Read More from VentureBeat http://bit.ly/2EKBjD4

Uber claims top spot in Indian ride-hailing market

Uber facilitated 14 million rides a week in India last year, the American ride-hailing firm said as it claimed the tentpole position in the key overseas market. In a report  (PDF) published on the sidelines of its quarterly earnings Thursday afternoon , Uber said that it commanded over 50% of the ride-hailing market in India — among some other regions — and was the category leader. The publicly listed company cited its internal estimations for the claim, it said. In comparison, Uber handled 11 million rides a week in India in 2018, a spokesperson told TechCrunch. The revelation is especially interesting, since both Uber and its chief local rival Ola have tended to avoid talks about the number of rides they serve in India. In a 2018 blog post , Ola revealed that its platform “moves over two million people every day.” A spokesperson for the Indian startup, which like Uber counts SoftBank as an investor, declined to reveal the new figures, but issued a statement in which it ...