Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hardware.pin1.configure(DIGITAL_OUT)
- server.setsendtimeoutpolicy(RETURN_ON_ERROR, WAIT_FOR_ACK, 10)
- data <- blob(4096)
- state <- 0
- function blink()
- {
- // Turn LED on or off
- hardware.pin1.write(state)
- // Write a message to the server
- // (we append data to end to simulate sending lots data)
- server.log(state.tostring() + data.tostring())
- // Flip state
- if (state == 1) state = 0; else state = 1
- // Call blink with new state
- imp.wakeup(0.01, blink)
- }
- blink()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement