Asked — Edited

Halloween Is Coming Soon

Hello To All,

This time of year my old plc controllers and arduino ends up at my friends Halloween Barn. I program a number of displays for our friends, both fiends and ghouls amusement.

This year my poor robots will become brainless for a while and two of my ezbv4's will become an addition to the party. One may run a talking head with facial tracking.

I was wondering if the object tracking mode works with an IR camera hooked to my computer? I would like to use my second ezb to run servos and a couple relays using object location and tracking (people) in the dark.

Any experiences or ideas?

Ron R


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#9  

Rich and Richard R, I need an example of a running counter, and how to set it up.

I don' know the way to set up the code to identify the counter, set the initial count to zero, and make it increment,. Rich showed me the code needed but I need an example somewhere to get a idea.

I would think this would be a good tutorial. Multiple digital inputs could operate different sequences. I know others new to scripting would use it.

Ron R

#10  

Hello

Here is the code I tried for the counter/sequencer. I know I am missing something, but I think I am on the right track. Any advice?

Digital_Wait(D0, ON, 50) waits 50ms for digital change

WaitForChange(GetDigital(D0))

$counter=0

if(GetDigital(D0)=1) #true Sleep(500)

$counter++

if($counter =1)

Say("EZB is on") Sleep (500)

if($counter=2)

Say("one, two") sleep(500)

if($counter=>3) #false do something

endif

The digital switch works now. I assume I need to add a 10k resistor from signal to ground to hold it low and work when I push the button.

Ron R

#11  

Once I get the counter running I will want it to loop. I will change the last line to

If($counter=>10)

$counter=0

Do I put in some kind of Goto to bring it to the top or leave an endif? I want it to run until I stop it in the script box.

Ron R

#12  

Hi Richard R, Rich and All,

The button is working and I can run single scripts. I am still trying to get the counter to work. It is the last part needed to finish Mandame Ninndo. The code I tried hasn't worked. I know I am close, but missing something. A working 3 step counter with a loop example would help me. I need to build the 25 step sequencer to run the "fortune" list and animation.

@Rich The example is the function I want, but I need to know a little more on how to build the counter.

I also need to learn how to post the code from my script list. @Richard R mentioned it. Is there a tutorial?

Any help would be appreciated. My deadline is coming up soon.

Thanks,

Ron R

#13  

Your code re-worked to run in a loop... You need an "endif" for every "if" statement used (see below)... to post code use the UBB code on the right side of the page... look down where it says code... use .... [codes] then your code you want to post [/codes] after your code... NOTE codes above should be code not codes.... Had to use codes or the format wouldn't show when I posted this... example...

[codes] ... (note you will type code not codes)

#your code you want to post

[/codes] ... (note you will type code not codes)


$counter=0
:loop
WaitForChange(GetDigital(D0))

if(GetDigital(D0)=1) # button press was true
Sleep(500)

$counter++ #add 1 to the button counter

if($counter =1)

Say("EZB is on")
Sleep (500)

elseif($counter=2)

Say("one, two")
sleep(500)

elseif($counter=>3) 

print("do something else")

endif
endif
goto(loop)

#14  

Thanks Richard R.

I did't know what statements to use with what, but I am learnring. I will test out what you showed me, then build it larger and try and run the first section of the "fortunes".

Ron R

#15  

Hello,

Sequencer update.. All is working.. I advance every time the button is pressed. It loops back to zero after 30 skits. I hope to run full skits, which includes movement, text to speech and relay controlled lighting next week.

It works in pieces, but the full test will be next week. I will post my progress then.

Ron R