Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- while 1==1 do
- val = rs.getAnalogInput("front")
- if val > 8 then
- val = val - 8
- rs.setAnalogOutput("back", 15)
- else
- rs.setAnalogOutput("back", 0)
- end
- if val > 4 then
- val = val - 4
- rs.setAnalogOutput("left", 15)
- else
- rs.setAnalogOutput("left", 0)
- end
- if val > 2 then
- val = val - 2
- rs.setAnalogOutput("right", 15)
- else
- rs.setAnalogOutput("right", 0)
- end
- if val > 1 then
- rs.setAnalogOutput("bottom", 15)
- else
- rs.setAnalogOutput("bottom", 0)
- end
- sleep(1)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement