You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Attach a tilt switch to GPIO26s=sensor.attach("TILT_SWITCH", pio.GPIO26)
-- Register a callback. Callback is executed when some sensor property changes.s:callback(
function(data)
if (data.on==1) thenprint("on")
elseif (data.on==0) thenprint("off")
endend
)