November 27, 2024, 01:33:32 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Basic Servo Toy with PIR

Started by wseay, December 14, 2009, 12:38:57 AM

Previous topic - Next topic

wseay

I have some downtime and I would like to start getting to know my Prop-SX.  I would like to create a simply toy that when triggered by a PIR, it jiggles a servo back & forth.  I will attach some Jingle Bells to the servo.  Now visitors will be greeted by the Merry Jingle Bells when they walk up to the door.

I realize that the SX board is way overkill for this.  But I thought this would be a good base to get started with.

I appreciate any code to get me started.

JonnyMac

Would you be more specific about "back and forth"?  Is this full CW to full CCW?  On random position to another?  And for how long should that movement continue after the detection of a PIR input?
Jon McPhalen
EFX-TEK Hollywood Office

wseay

Once triggered, the servo should move CW 90 degrees from home in one second and then back to home in another second (approx).  The servo will be mounted with the horn pointing down and the bells suspended underneath.  So I don't think we will need to hold the servo position.

The routine should repeat three times and then wait 1 minute before the next trigger.

JonnyMac

So, basically...

1) Wait for trigger
2) Ding, ding, ding....

Where the servo handles the with about a 1-second delay in between?
Jon McPhalen
EFX-TEK Hollywood Office

wseay

More like jingle, jingle, jingle.  :D

But yes, you are correct.

I know how to do this with my Prop-1.  But I thought this would be a good transitional project for the Prop-SX.