Reply To: USB Button Solution

Home Forums AR Sandbox Forum USB Button Solution Reply To: USB Button Solution


For the RiverWey Trust version of the SARndbox, I’ve now set up three USB buttons – Flood, Drain, and Cycle – where the first is the global water tool, Drain is.. drain, and the third assigns a script (as in Oliver Kreylos’ post above) which cycles round the Water, Lava, Snow options
three buttons on the box

As a green bash script coder this works but is probably a bit clunky!


# pick up current state
  weather=$( cat /home/sandbox/src/scrip/weather_file.tmp )
  echo "Current state is " $weather
# use case statement to set the assignment to the next cycle value
    case $weather in
     "rain") echo "Changed rain to lava"
            sh /home/sandbox/src/scrip/
            echo "lava" > /home/sandbox/src/scrip/weather_file.tmp
     "lava") echo "Changed lava to snow"
            sh /home/sandbox/src/scrip/ 
            echo "snow" > /home/sandbox/src/scrip/weather_file.tmp
     "snow") echo "Changed snow to rain"
            sh /home/sandbox/src/scrip/ 
            echo "rain" > /home/sandbox/src/scrip/weather_file.tmp

The switch scripts are versions of those appearing in the ‘snow shader’ topic in this forum ..

cp ~/src/scrip/SurfaceAddWaterColor-Lava.fs ~/src/SARndbox-2.3/share/SARndbox-2.3/Shaders/SurfaceAddWaterColor.fs

using suitably updated versions of SurfaceAddWaterColor.fs

For the USB buttons, the Reyann branded button options in UK came out at some hugely inflated price on Amazon UK (equivalent $60+)… so xSource ( at £16.99 ($22) for the same solution is much better … and there is an option for the board without buttons should you wish.

Comments are closed.