DHT11 Temp & Humidity Sensor icon DHT11 Temp & Humidity Sensor — Read DHT11 temperature and humidity on Arduino (signal pin 4) using EZ-Genuino_DTH11_Uno firmware; exposes $Temp and $Humid variables. Try it →
Canada
Asked — Edited
Resolved Resolved by thetechguru!

Voice Command And Recognition

Hello,

I am trying to write a simple block of code for Roli that will wait for a command, and have the robot repeat it.

When I say something the $ValSpeech variable is assigned the right value, but it will jump to the else every time.

When I click "Hello" or "Bye" from the Run screen, the robot will say the proper command.

Here is my code:

$ValSpeech = WaitForSpeech( 30, "Hello", "Bye")

If ($ValSpeech = "Hello") SayEZB("Hello") ElseIf ($ValSpeech = "Bye") SayEZB("Goodbye") Else SayEZB("Could you say that again?") EndIf

If there any problems with the code i provided could someone please help?

Thank you.


ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

Author Avatar
Canada
#9  

Thank you for the response. It was because of the case sensitive comparison in the if statements!