Post your best Lua script examples here

User avatar
By doku-so
#29293
gwizz wrote:<edit> there is an improved version of script below</edit>
...
2015 is gonna be a great year for IoT gadgets!!!
G


Thank you for posting this script! Although I have a job as a software developer (mainly C#/ASP.NET), Lua is new to me. And even more so, I've had little to no experience working with a board like the NodeMCU, before ESP8266.

Thanks to this little scanner program I know that the ESP discovered my BMP180 pressure/temperature sensor :D

Next step will be to actually do something useful with the sensor values ;)

I started out with C/C++ programs in Arduino IDE and the AdaFruit Unified Sensor Library (which includes BMP180 support).
But I wasn't getting any readings. So I guess I'll stick with NodeMCU Lua firmware for a while. Using LuaLoader it's easy to upload scripts, compared to constantly re-flashing the entire ESP using ArduinoIDE (esptool.py).
User avatar
By AbhishekVid
#30467 Hello,

I am using esp 01 and trying to connect an atmega16 controller on i2c. After the using the scanner I am getting the following Output. Please let me know where I am going wrong. Thanks in advance.

Scanning I2C Bus
Device found at address 00
Device found at address 01
Device found at address 02
Device found at address 03
Device found at address 04
Device found at address 05
Device found at address 06
Device found at address 07
Device found at address 08
Device found at address 09
Device found at address 0A
Device found at address 0B
Device found at address 0C
Device found at address 0D
Device found at address 0E
Device found at address 0F
Device found at address 10
Device found at address 11
Device found at address 12
Device found at address 13
Device found at address 14
Device found at address 15
Device found at address 16
Device found at address 17
Device found at address 18
Device found at address 19
Device found at address 1A
Device found at address 1B
Device found at address 1C
Device found at address 1D
Device found at address 1E
Device found at address 1F
Device found at address 20
Device found at address 21
Device found at address 22
Device found at address 23
Device found at address 24
Device found at address 25
Device found at address 26
Device found at address 27
Device found at address 28
Device found at address 29
Device found at address 2A
Device found at address 2B
Device found at address 2C
Device found at address 2D
Device found at address 2E
Device found at address 2F
Device found at address 30
Device found at address 31
Device found at address 32
Device found at address 33