Asked — Edited

Turning Digital Ports On/Off With Speech?

Hello all When I'm using a Movement Panel the digital ports work (using "set digital" to verify, it turns red when off and green when it's on) but somehow when I try to use speech control to turn the same port on, it doesn't work.

Can someone test this for me, or is this a possible bug?

Thanks all.:P


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

United Kingdom
#1  

I just tried set(d19,off) for an LED I have with voice rec and it worked ok. Is that what you were asking? Is it recognising your voice command?

#2  

hmmm ok That's what I was asking but it's not working for me...yes it is recognizing my voice command...let me try again

#3  

Nope didn't work. I also put SayWait("it's working") right after, and SayWait works but the digital port does not turn on...very weird

United Kingdom
#4  

Are you writing the code as

setdigital(D#,On)

Or

set(D#,On)

It's the second one that worked for me.

#5  

Im using the second one.

Here:

set(D1, ON) sleep(250) set(D1, OFF) sleep(250) set(D8, ON) SayWait("I am turned on")

Nothing happens but the "I am turned on" part:D

United Kingdom
#6  

Maybe put a sleep() in between the last digital command and the say"" command to see if that makes a difference.

#7  

Try increasing the sleep commands to 1000 .... they may be happening so fast you wouldn't be able to perceive the on/off transition....

#8  

Nope same thing. I'll try another computer when I get home.

#9  

Also try closing and reloading your project and/or creating a new one and test it again with longer sleep commands...

I assume you got your v4 then?

#10  

try this..


set(D1,off)
set(D8,off)
sleep(2000)
set(D1, ON)
sleep(1000)
set(D1, OFF)
sleep(250)
set(D8, ON)
SayWait("I am turned on")

#11  

@Richard R

Nah dude I had to cancel the V4 order to make way for the mold making materials...However I have a V4 and Camera coming my way from someone...maybe within the week

Its so weird man because I'm using the same ports on a Movement Panel and they all turn "high" on voice command...

#12  

So you using a V3 then? Can you upload the project, maybe.... ? Try it on you other PC when you get home... Also if it still doesn't work save a copy of your project and start removing components and or controls until it works... This should work...It is possible another component in your project is interfering with the set() command... Also try doing this from a basic script to see if it works that way....

#13  

@Doombot ...also remember Occum's Razor.... It's probably the simplest reason that is keeping this from working...:)

United Kingdom
#14  

Yeah, your script worked for me no problem and with no changes to sleeps. But, I am using a v4. Best to use Richards advice on this one. I had to do exactly that 1/2 hour ago with my project and solved my issue by doing what exactly what Richard has said about deleting components on a copied project.

#15  

@Richard R It shouldn't matter if it's V3 or not...I'm just playing around with the software at work so i can test the shoulders when I get home...

Oh it's "Occam's Razor"...hah:D

#16  

I was just curious if you had received you V4 yet, that's all.... I just put salt in my eyes because of my spelling mistake...:P I will repent my friend:P

#17  

@Richard R

"Occum" haha I don't think it's a spelling mistake, it's a Freudian slip...what else are you doing on your computer eh? Careful the missus might catch you :D

#18  

@Marc.... she would be really bored if she went through my web history.... LOL

#19  

@all

I'll test this when I get home then I will resolve the issue. Thanks!

#20  

I would try to sleep for 5000 . Equals around 5 Seconds.

But if for the other person it worked fine . . . You may have a windows or memory problem. Or you may have to download and re-install ARC.

Good Luck!

#21  

@MovieMaker

Thanks for the help brotha...but I don't think it's a "sleep" problem...most of my test scripts don't even have sleep in between commands just usually at the end of the script block...I do think there is something interfering but I posted it here because i thought it could be a possible bug...

I laways use the latest ARC so it's not that, and I have a pretty decent laptop...

#22  

I tried this:

saywait("start test script") set(D8, ON) if(getdigital(D8) = "1") saywait("digital eight is working") elseif(getdigital(D8) = "0") saywait("digital eight is not working") endif

Of course I opened a "set digital" control to monitor it... And like you guessed, when I run the script I get "start test script" and "digital eight is not working"....

United Kingdom
#23  

Have you tried it using a different port other than D8?

United Kingdom
#25  

Strange. I'm running out of ideas now. So the script runs ok on its own without voice recognition, correct? Are you running the script in the voice rec control as a script block, or a ControlCommand() in the phrase configuration?

In post #6 you posted a script you was using. Have you tried a simple set(D8,on) on its own in the script in the speech rec control?

#26  

@Doombot you need to remove the quotes from "1" and "0"...should be


if(getDigital(D8)=1)
saywait("it is working")
elseif(getDigital(D8)=0)
saywait("it is not working")
endif

PRO
Synthiam
#27  
  1. Are you having trouble with D8 only?

  2. Is your SET(on) and set(off) working for other ports?

Richard is correct, "Quotes" are for "Strings".

String A string consists of alphanumeric characters to create words. "This" is a strong. So is "This". And "This is a string containing a sentence".

Example: $x = "This is a string"

Numbers Numbers are simply numeric. A number is a 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 only. The only additional symbols you can use for numbers are a - (minus) and a . (decimal)

Example: $x = 3.14

#28  

@Dj

I just got home and tried it. Everything I did in the beginning worked, I just needed the EZb to be connected...very weird but it works.

@Richard R and @Dj Thanks! I'm sure I know that (by now) I was just beat and I forgot...but thanks for the correction kind sirs.

On to testing! To those who care I'm just finishing up the cosmetics on my bot! Mechanically it's sound and ready to kill!

:D

United Kingdom
#29  

Sounds like you may have it sorted then. Looking forward to seeing the end results of your bot.:)

#30  

@ Doombot
Hi, Any pictures yet? The weather is getting nice, so I can't wait to see him by the Harley..

What was the final script you ended up with?

Ron

#31  

Doombot did this ever get completely resolved? I'm having very similar issue.

#32  

@ANDY ROID

Those are just test scripts, but I do use a lot of set() commands since I use a lot of motors and tip120 circuits...so i turn on/off digital pins a lot...

Oh no pictures just yet...

@kamaroman68 No it was resolved on it's own, since the test scripts i wrote worked when the EZb was connected...it wasn't working when the EZb is NOT connected. I don't know why...but instead of giving credit to anyone I just left it unresolved. What issue do you have? Maybe I can help...

PRO
Synthiam
#33  

yes, the EZ-B needs to be connected for any commands that communicate with the ez-b to work.

@Kamaroman68, do you have any additional information of what you're doing? To use speech recognition is very easy. Simply add the code to your voice command

  1. load latest ARC

  2. add speech recognition (controls -> add control -> audio -> speech recognition)

  3. press GEAR config icon on speech recognition control

  4. Enter a new phrase "turn digital port on"

  5. press the script edit to edit the script for the new phrase

  6. enter this script: SET(D0, ON)

  7. Enter a new phrase "turn digital port off"

  8. press the script edit to edit the script for the new phrase

  9. enter this script: SET(D0, OFF)

Now say those two phrases and you will turn D0 on and off

If the speech is not being detected, press the ? (question mark) next to the X (close) to find out how to train your voice. Here's a direct link to the help for training your voice: https://synthiam.com/Tutorials/Help.aspx?id=90