Post your best Lua script examples here

User avatar
By RaspberryPiThree
#51428 When I save this code as a close.lua file and run dofile("close.lua") nothing happens. Please help.

gpio.mode(4,gpio.OUTPUT)
gpio.write(4,gpio.HIGH)
gpio.mode(3,gpio.OUTPUT)
gpio.write(3,gpio.LOW)
gpio.mode(3,0)
User avatar
By hkubota
#53439 gpio.mode(3,0)

makes no sense to have in this code. But it's unlikely the problem here.
Have you checked that D3/D4 do not have HIGH resp. LOW?
What did you expect will happen?