Asked — Edited

Oh Boy I Need A Little Basic Help

Hi!

After a long, long two weeks of mind-draining work, both my sons sprung a - let's build a leprechaun trap using an ultrasonic sensor and a servo - project on me.

While I know that I can figure it out if i had a few more days of lead time, would someone help me relearn how to get an ultrasonic sensor to trigger a servo to move 45 degrees in one direction, pause 2 seconds then return to its original position?

I promise to revisit the tutorials when I mentally recover from my day job, so I won't ask such a question again.

Anyway, a sincere and humble thank you.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Synthiam
#1  
  1. load ARC

  2. add a script control (https://synthiam.com/Support?id=40)

  3. edit script and add this code and configure your own ports for servo and ultrasonic sensor

User-inserted image

PS, you can also add some SAYEZB command in the IF condition that says out of the speaker "I TRAPPED ONE!" or something...

#2  

Thanks DJ!

My sons will be excited to finish their "high-tech" trap!

I'm sure they will be more than happy to share a part of their pot of gold bounty should they catch the leprechaun.

Scott

#3  

HI DJ,

Thanks again for your help!

While the boys didn't catch the leprechaun, they had a great time creating their trap.

User-inserted image

Never rest on your laurels, I guess. My boys are already planning next year's trap. I heard something about lasers, a falling cage and magnets.

Scott

PRO
Synthiam
#4  

That's awesome! I bet they had a great time - thanks for sharing:D