 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
xxeyes
Joined: 18 Feb 2007 Posts: 3
Digg It |
Posted: Sun Feb 18, 2007 10:34 pm Post subject: Please help me with my GlovePie script! |
|
|
Please help...
I have no scripting/programming experience whatsoever, but I have been reading this forum and the other WiiLi resources for a few days now. I’ve managed to write the following script:
//Resets PowerPoint presentation and LEDs
if Wiimote.Pitch > 45 degrees and < 90 degrees then
Wiimote.Led1 = true
Wiimote.Led2 = true
Wiimote.Led3 = true
Wiimote.Led4 = true
home = true
wait 1 s
home = false
//Advances PowerPoint presentation slowly
elseif Wiimote.Pitch < -25 degrees and > -49 degrees then
right = true
wait 2 s
right = false
//Advances PowerPoint presentation at medium speed
elseif Wiimote.Pitch < -50 degrees and > -74 degrees then
right = true
wait 1 s
right = false
//Advances PowerPoint presentation quickly
elseif Wiimote.Pitch < -75 degrees then
right = true
wait 500 ms
right = false
endif
This all seems to work well. Now here is where I need help…
I want to turn off the four LEDs on the Wiimote, one at a time every twenty-five “right” keystrokes that are emulated by the Wiimote movement, as scripted above. Given that this script is for a PowerPoint presentation of 100 slides, the desired effect is for the Wiimote LEDs to represent the remaining portion of slides in the presentation. The user should then be able to pitch the Wiimote back to reset the presentation and turn all the LEDs back on [this is already scripted above] at any time. Thus, it will be necessary to have the count(down?) from 100 reset with this action as well.
I’ve been working at it all day, but I have no idea how to achieve this and I can’t seem to figure it out by looking at other related scripts. I would really appreciate any advice, help, or if you want to just write it out for me, that would be even better.
If you are wondering, I’m doing this for a school art installation. The Wiimote will be built into a “pouring” mechanism. It will control a PowerPoint “presentation” projected onto the floor from above. I will animate the presentation so that small images pile up under the “spout” and “flow” outward across the floor. It’s kind of crude, but it is the best effect I can hope to achieve with the lack of programming skills, and little time that I have.
Thanks very much for any help you might offer. I’m impressed with the community here. I can’t wait to finish this project so I can just mess around with the scripts people have written. I didn’t know this kind of stuff existed until recently. |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Sun Feb 18, 2007 11:30 pm Post subject: |
|
|
Not sure which direction you wanted them to turn off in, but I'm sure you can figure out how to reverse it if necessary.
| Code: | if (!var.init) then
var.count = 100
var.init = true
endif
Wiimote1.Led1 = (var.count > 75)
Wiimote1.Led2 = (var.count > 50)
Wiimote1.Led3 = (var.count > 25)
Wiimote1.Led4 = (var.count > 0)
//Resets PowerPoint presentation and LEDs
if Wiimote.Pitch > 45 degrees and < 90 degrees then
var.count = 100
home = true
wait 1 s
home = false
//Advances PowerPoint presentation slowly
elseif Wiimote.Pitch < -25 degrees and > -49 degrees then
right = true
wait 2 s
right = false
var.count--;
//Advances PowerPoint presentation at medium speed
elseif Wiimote.Pitch < -50 degrees and > -74 degrees then
right = true
wait 1 s
right = false
var.count--;
//Advances PowerPoint presentation quickly
elseif Wiimote.Pitch < -75 degrees then
right = true
wait 500 ms
right = false
var.count--;
endif |
|
|
| Back to top |
|
 |
xxeyes
Joined: 18 Feb 2007 Posts: 3
Digg It |
Posted: Mon Feb 19, 2007 1:31 am Post subject: |
|
|
TylerK:
Perfect! Exactly what I was looking for, thanks very much. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|