User:Kd8ikt

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Rave shell script)
(Rave shell script)
Line 24: Line 24:
  
 
#!/bin/bash
 
#!/bin/bash
 
+
#/hacker/kd8ikt
 +
#this could be a neat silent ringer
 +
#but needs a proper shutdown and pid i'd think or start/stop funtion like an init script
 +
#
 
#Define Constants
 
#Define Constants
 
e=echo
 
e=echo
Line 30: Line 33:
 
pow_b=/sys/class/leds/gta02-power\:blue/brightness
 
pow_b=/sys/class/leds/gta02-power\:blue/brightness
 
pow_o=/sys/class/leds/gta02-power\:orange/brightness
 
pow_o=/sys/class/leds/gta02-power\:orange/brightness
#vib=/sys/class/leds/neo1973\:vibrator/brightness
+
vib=/sys/class/leds/neo1973\:vibrator/brightness
  
 
#DEFINE VARIABLE
 
#DEFINE VARIABLE
Line 40: Line 43:
 
RANGE=2
 
RANGE=2
 
let "randy %= $RANGE"
 
let "randy %= $RANGE"
 +
}
 +
 +
#vibrator magic
 +
get_rand_vib(){
 +
randy_vib=$RANDOM
 +
RANGE=200
 +
let "randy_vib %= $RANGE"
 
}
 
}
  
Line 50: Line 60:
 
get_rand
 
get_rand
 
$e $randy > $pow_o
 
$e $randy > $pow_o
 +
 +
get_rand_vib
 +
$e $randy_vib > $vib
  
 
done
 
done
  
 
</pre>
 
</pre>

Revision as of 08:28, 30 July 2008

much <3 openmoko

James Lutz Cincinnati, Ohio USA

kd8ikt at fuse.net

my useless home hosted webserver ipv6+ipv4
http://we.trekbeyond.org/

call me on my moko 513 476 nine six nine four

Current Projects

bubble level

  • STAGE=planning
    • pygtk ?

using accelerometer input we will make a simple bubble level

Rave shell script

randomly togles all the lights on/off


#!/bin/bash
#/hacker/kd8ikt
#this could be a neat silent ringer 
#but needs a proper shutdown and pid i'd think or start/stop funtion like an init script
#
#Define Constants
e=echo
aux_r=/sys/class/leds/gta02-aux\:red/brightness
pow_b=/sys/class/leds/gta02-power\:blue/brightness
pow_o=/sys/class/leds/gta02-power\:orange/brightness
vib=/sys/class/leds/neo1973\:vibrator/brightness

#DEFINE VARIABLE
chilltime=1

#DEFINE RANDOM # GENERATOR FUNCTION
get_rand(){
randy=$RANDOM
RANGE=2
let "randy %= $RANGE"
}

#vibrator magic
get_rand_vib(){
randy_vib=$RANDOM
RANGE=200
let "randy_vib %= $RANGE"
}

while [ 1 == 1 ]; do
sleep $chilltime
get_rand
$e $randy > $aux_r
get_rand
$e $randy > $pow_b
get_rand
$e $randy > $pow_o

get_rand_vib
$e $randy_vib > $vib

done

Personal tools

much <3 openmoko

James Lutz Cincinnati, Ohio USA

kd8ikt at fuse.net

my useless home hosted webserver ipv6+ipv4
http://we.trekbeyond.org/

call me on my moko 513 476 nine six nine four

Current Projects

bubble level

  • STAGE=planning
    • pygtk ?

using accelerometer input we will make a simple bubble level

Rave shell script

randomly togles all the lights on/off


#!/bin/bash

#Define Constants
e=echo
aux_r=/sys/class/leds/gta02-aux\:red/brightness
pow_b=/sys/class/leds/gta02-power\:blue/brightness
pow_o=/sys/class/leds/gta02-power\:orange/brightness
#vib=/sys/class/leds/neo1973\:vibrator/brightness

#DEFINE VARIABLE
chilltime=1

#DEFINE RANDOM # GENERATOR FUNCTION
get_rand(){
randy=$RANDOM
RANGE=2
let "randy %= $RANGE"
}

while [ 1 == 1 ]; do
sleep $chilltime
get_rand
$e $randy > $aux_r
get_rand
$e $randy > $pow_b
get_rand
$e $randy > $pow_o

done