User avatar
By Jaume Olivé
#60016 We are glad to announce a preview of Lua RTOS for ESP32. Lua RTOS is the main-core of the Whitecat ecosystem, that is being developed by a team of engineers, educators and living lab designers, designed for build Internet Of Things networks in an easy way.

There are many things to do, but for the moment the following is available:

* Lua 5.3.2 interpreter at the top
* Lua Threads
* LMIC LoRa WAN stack
* PAHO MQTT
* GPIO driver
* SPI driver
* ADC driver
* SD Card driver
* FAT files ystem
* SPIFFS file system
* TFT ST7735 driver

One of the most important things of Lua RTOS is the ability to run functions for running Lua functions into native threads. Unlike Lua coroutines, native threads are scheluded by the operating system, and all threads share the same Lua state:

Code: Select allthread.start(function()
  pio.pin.setdir(pio.OUTPUT, pio.GPIO14)
  pio.pin.setpull(pio.NOPULL, pio.GPIO14)
  while true do
    pio.pin.setval(1, pio.GPIO14)
    tmr.delayms(100)
    pio.pin.setval(0, pio.GPIO14)
    tmr.delayms(100)
  end
end)


Lua RTOS is available as an esp-idf component in https://github.com/whitecatboard/Lua-RTOS-ESP32.
Wiki is available at https://github.com/whitecatboard/Lua-RTOS-ESP32/wiki.

The Lua RTOS compatible boards can be programmed in two ways: using the Lua programming language directly, or using a block-based programming language that translates blocks to Lua. No matter if you use Lua or blocks, both forms of programming are made from the same programming environment. The programmer can decide, for example, to made a fast prototype using blocks, then change to Lua, and finally back to blocks:

https://github.com/whitecatboard/blockly-environment

Best regards,

Lua RTOS team