| View previous topic :: View next topic |
| Author |
Message |
nfearnley
Joined: 31 Jan 2007 Posts: 1 Location: Ontario, Canada
Digg It |
Posted: Wed Jan 31, 2007 5:31 am Post subject: TiltLED |
|
|
I wrote a really short but cool script.
One of the 4 leds in the remote is lit. When you tilt the remote to the right, the light 'falls' to the right. When you tilt the remote to the left the light 'falls' to the left. Depending on how far you tilt the remote determines how fast the light 'falls'.
| Code: | // TiltLED
// Written by Nathan Fearnley
// Tilt the remote to either side to make the light 'fall' to that side
// This sets the initial leds and the rate at which glovepie loops the script
if pie.frame = 0 then
pie.Framerate = 10Hz
var.led = 2
endif
// This is the actual working code
if abs(wiimote.Gx) > 0.3 then var.led = var.led + wiimote.gx
if var.led < 0 then var.led = 0
if var.led > 3.9999999999999 then var.led = 3.9999999999999
wiimote.leds = 8 shr int(var.led)
|
|
|
| Back to top |
|
 |
speaker219
Joined: 28 Jan 2007 Posts: 187 Location: New York
Digg It |
Posted: Wed Jan 31, 2007 9:53 pm Post subject: |
|
|
Hey thats pretty cool, nice work
its like dripping water sorta |
|
| Back to top |
|
 |
|