Guest User

Untitled

a guest
Mar 24th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.78 KB | None | 0 0
  1. #!/bin/bash
  2. # Basic Script for the Nexus Q that will have a "bouncing" rainbow on the light ring. Requires mcsaucy's work.
  3.  
  4. # Starting Color Placements
  5. Count=1
  6. Rotation=0
  7.  
  8. # Start the loop!
  9. while [ true ]
  10. do
  11.    
  12.     # Do we go forwards or backwords?
  13.     if [ $Rotation -eq 1 ]
  14.     then
  15.         avrlights $Count 6 0xff 0x8888 0xff00 0x888800 0xff0000 0x0
  16.         let "Count -=1"
  17.     elif [ $Rotation -eq 0 ]
  18.     then
  19.         avrlights $Count 6 0x0 0xff 0x8888 0xff00 0x888800 0xff0000
  20.         let "Count +=1"
  21.     fi
  22.    
  23.     # Set rotation if it is time for next loop cycle
  24.     if [ $Count -eq 27 ] ;
  25.     then
  26.         let "Rotation = 1"  
  27.     elif [ $Count -eq 1 ] ;
  28.     then
  29.         let "Rotation = 0"
  30.     fi
  31.  
  32.     # Sleep time
  33.     /system/xbin/sleep .0001
  34.  
  35. done
Advertisement
Add Comment
Please, Sign In to add comment