-- Buzzer -- 0.1 -- Anne Jan Brouwer interval = 500 gpio.mode(5,gpio.OUTPUT) n = 0 vibrate = function (state) if state == true then tmr.alarm(3, interval, 1, function() if n % 2 == 0 then gpio.write(5,gpio.HIGH) else gpio.write(5,gpio.LOW) end n = n + 1 end) else tmr.stop(3) gpio.write(5,gpio.LOW) end end print("to stop type: vibrate(false)") vibrate(true)