diff --git a/blinky.lua b/blinky.lua new file mode 100644 index 0000000..be74548 --- /dev/null +++ b/blinky.lua @@ -0,0 +1,24 @@ +local GPIO = require('periphery').GPIO +local clock = os.clock +local gpio_4 = GPIO(4, "out") + +function sleep(n) + local t0 = clock() + while clock() - t0 <= n do end +end + +--function wait(seconds) -- This function doesnt give real seconds +-- local start = os.time() +-- repeat until os.time() > start + seconds +--end + +while 1 + do + gpio_4:write(0) + sleep(2) +-- wait(2) + + gpio_4:write(1) + sleep(0.2) +-- wait(0.2) + end