Advertisement
Guest User

test_music

a guest
Jul 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. function play_note(n)
  2.   print("playing note ", n)
  3.  
  4.   if n > 15 then
  5.     frnt = n - 15
  6.     bot = n - frnt
  7.   else
  8.     bot = n
  9.     frnt = 0
  10.   end  
  11.  
  12.   rs.setAnalogOutput("bottom", bot)
  13.   rs.setAnalogOutput("front", frnt)  
  14. end
  15.  
  16. function main()
  17.   for i=0,30,1 do
  18.     play_note(i)
  19.     sleep(1)
  20.   end
  21.  
  22.   rs.setAnalogOutput("bottom", 0)
  23.   rs.setAnalogOutput("front", 0)
  24. end
  25.  
  26. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement