
MovieMaker
USA
Asked
— Edited

I have tried every which a way and I cannot find a way to hook the PIR to the EZB. I have tried Analog,Digital, etc. I bought a dozen of these units - the ones with the TWO Potentiometers on the PC. You help would be appreciated.
Thanks,
I know that the EZB has to remain powered up. Just have all of the servos power down
Well I think you answered you own question... Use Release all to save power on the servos...
But this is what I'm trying to do;
I would like my robot to power down (servos) after a specified time of inactivity, then when the PIR senses movement the robot will power up and run a script.
I am not sure what you're asking... Use the waitforchange (or my code) command in an active script... When motion is detected then do exactly what you said... Use ControlCommand("PowerUp", ScriptStart) in you motion detected script to start your script called PowerUp ....
You will of course need to create a script called PowerUp and put in it what you want the robot to do when it wakes up from motion detected....
What will the robot be doing while it's counting down to shut down servos?
This topic may be of some assistance to you. It's not exactly what you are asking for but should put you on the right track in the right direction at least.
Here's what I got so far. Not exactly what I want but I'm starting to understand it more. This just repeats over and over;
repeatUntil(1=2) set(D11,OFF) #You might need this line as well, not sure sleep(20) $motion=getDigital(D11)
IF($motion=1) #pin went high ControlCommand("Auto Position", AutoPositionFrameJump, "Wakeup") Sleep(1000) sayezb("i am awake now") sleep(2000) ControlCommand("Auto Position", AutoPositionFrameJump, "Rest")
endif
sleep(10000) endRepeatUntil
Now I need to add a "timer" so that If the robot does nothing for X amount of time it will release all servos but continue to poll the PIR. Then when it senses motion it will power up do the above ONCE and then go back to "Timing" for the next event.
Thanks Rich I will start reading
For a timer you can use something as crude and simple as a counter script like so...
Obviously it needs more to it as it doesn't actually do much other than count down but the idea is there. There are other methods too, the above may not be the best method (I didn't really think about it much) but it's a method that you can build on.
Basically it will count down for 1 minute with 1 second intervals. Throw the controlcommand, if, etc. either before or after the sleep (it doesn't really matter which side you put it).
Thanks I'll keep working on it