More info about eLua is available on the eLua project website:
http://wiki.eluaproject.net/
The source code for the STM32Expander eLua firmware is located here:
http://github.com/omnima/elua
With eLua running on the STM32Expander it's easy to access all the integrated peripherals.
For example the 1-wire Lua module allows simple access to the 1-wire bus and any attached 1-wire devices.
CODE
w1.init()
s,r=w1.first() -- enumerates the 1-wire bus and returns the first found 1-wire device id
=w1.getvalue(s) -- returns temperature (if DS18B20 sensor) or status of the given 1-wire device
s,r=w1.next()
if s[1]==0x28 then print("This is DS18B20 temperature sensor") end
if s[1]==0x29 then print("This is DS2408 8 port switch") w1.set(s,0xff) end --sets all 8 ports to 1s
s,r=w1.first() -- enumerates the 1-wire bus and returns the first found 1-wire device id
=w1.getvalue(s) -- returns temperature (if DS18B20 sensor) or status of the given 1-wire device
s,r=w1.next()
if s[1]==0x28 then print("This is DS18B20 temperature sensor") end
if s[1]==0x29 then print("This is DS2408 8 port switch") w1.set(s,0xff) end --sets all 8 ports to 1s
eLua also proides built-in support for GPIO access, i2c, spi, timer and pwm control. Refer to the eLua documentation for more information:
http://www.eluaproje...refman_gen.html
MiniEMBWiFi_STM32Expander.png 260.05K
3 downloads










