Openai Chatgpt icon Openai Chatgpt — ChatGPT chatbot for robots with memory, image description, personality scripting, and voice conversation via OpenAI API Try it →

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.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#1  

It does help to provide existing code that you have written so we can help build off of it. Could you paste your current code please? Thanks!

#2  

All I have so far is adc_wait(adc7,lower,50)

Im not sure how to add an if command say something out ezb speaker.

#3  

OK so I tried again.... how do I copy and paste what ive done? My code is this...

IF(ADC7,lower,50) SayEZB " I have detected something in my path " EndIf

It comes up with an error on line 1. Says missing quotes or invalid expression.

                                       Thanks   Chris
#4  

Your syntax is incorrect... The code doesn't make sense , but it should run... The if statement is redundant... meaning the if statement isn't needed because the code will continue only if the ADC_Wait returns above 50 ...


ADC_Wait(ADC7, HIGHER, 50)

$x=getadc(adc7)
IF($x>50)
SayEZB (" I have detected something in my path ")
EndIf

#5  

This is all you really need....


ADC_Wait(ADC7, HIGHER, 50) #the script stops here until the value exceeds 50

SayEZB (" I have detected something in my path ")

#6  

I agree with you to a certain extent... as we move closer to the sensor the number goes down not up. So what I am looking for is when something is detected closer. But I think I can modify what you did as an example. I will try , and then post back. Thanks Richard R

#7  

So modify it then...


ADC_Wait(ADC7, Lower, 50) #value lower than 50 or whatever value you want

SayEZB (" I have detected something in my path ")

#8  

Sorry Richard R , not working. I need to make sure i'm doing it right though. I just pulled out a script control and scripted inside it.