Congratulations Rich, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Help With Variable Input And Output For Faces

Assistance Requested

Help JustinRatliff with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

JustinRatliff claims to have checked these sources:

Well, I was working on a surprise for the group, but I need some help first. I have a nifty multiple face detection program working in So far I have it programmed to recognize my face, DJ Sures, Sarah Connor and Alan Turing. Minus my face, I figure all EZ-robots should know who the other three people are.

My C# app generates a change in variable and displays this in a label in the form to show who's name it is for the face it sees. For this to be useful for integration with EZ-Builder I need to get this variable out of my app an into EZ-Builder.

I see two ways to do this, one is write the data to a .txt file, have EZ-Builder keep checking this text file, read the text file, if the text changes then act on that. - This seems sloppy and slow.

Option 2 seems better which is to use TCP/IP and Telnet. I've viewed the tutorial here: and I fundamental understand it. I can connect to EZ-Builder with Telnet. I
I'm sure I can tell my C# app to send telnet data. What I can't wrap my head around is how to I make a script in EZ-Builder to look for an incoming variable on the TCP/IP port such as "$Face_Name" so that EZ-Builder can then act on that data?

Can someone help me with that? Or is there a 3rd option I'm not thinking of yet that would be better? I'm looking forward to get this figured out so I can share my app with the group.

Thank you!

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.

Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


WaitForChange is the command you are looking for.

Give me a minute or two and I'll knock up a quick script example for you.



# Make sure the variable exists and is reset
$FaceName = "null"

# Make an endless loop

# Wait until the variable changes

# Script commands to be run on change of facename variable

# Loop back to the start

It's that simple Smile No sleep should be required since the face probably wont change too quickly.


Ok, I added that as a script, ran it and I get Error in line 2 variable not defined $FaceName


Oh, wait, you changed it Smile


Updated the script a little Winky

All variables need to exist before using them in commands otherwise it'll throw that error. I usually define all variables as "null" or as 0 in the init script.

And yes, I changed it before you posted as I saw the potential problem Smile



This is an awesome thing.... How are you adding faces to the recognition engine? Will it be something users will be able to easily (or not easily, but without C# programming skill) do?

I would love to have my robot recognize me, my wife, my cat, and a couple of friends, and treat everyone else as stranger (or when in "security mode" potentially hostile).

I also love your choice of default recognized faces. I would suggest adding Issac Asimov.



@Rich - You Da MAN!

I'm getting so close I smell it. Thank you Rich!


@thetechguru It's an application that runs on its own. I am making it to share with everyone - anyone should be able to use it as a standalone app. If I get lucky I'll have the very pre-beta version ready to share tonight or tomorrow.


That is so cool of you. Way (way way way) down on my todo list was a plan to start learning OpenCV and build something similar, but if you have done the work already, it is one less thing I need to do Smile