Tag: lua

  • I broke up with Lua and got with arduino-cli for ESP8266 development

    I broke up with Lua and got with arduino-cli for ESP8266 development

    TL; DR With the advent of arduino-cli there are no more reasons to use Lua over C/C++ for ESP8266 programming. Please challenge me on that in the comments if you can 😉 I enjoyed a couple of years of writing asynchronous code in Lua. It was fun and intuitive for someone like me, with a…

  • A simple buzzer/piezo Lua library for NodeMCU/ESP8266

    A simple buzzer/piezo Lua library for NodeMCU/ESP8266

    I was working on a project that involved adding a buzzer and playing different notes. I ended up writing something pretty easy to use so decided to put it on GitHub to save people some time. Link to the repo: https://github.com/alexchumak/buzzkill-lua Usage Please note that in real life you would have a delay between the…

  • Use GPIO interrupts instead of sensor sampling to simplify code

    Naively, I’ve been using sensor sampling as the only way to detect changes in sensor readings. Shaking my head over here. Just sad. Sampling means periodically reading sensor value to detect changes. My period was typically around 10Hz, or 10 times every second. Not only it is wasteful in many cases, it also has a…