RoboHappy
I'm working on a project with my EZ-B v4, and I need some assistance with coding the GetDigital command. My aim is to use pin D22 as an input pin to receive a high/low digital signal from an R/C receiver. The receiver uses a PWM-to-digital output device on one of its channels. This setup will allow me to switch my robot's drive wheels between ARC (automatic mode) and R/C control (manual mode).
The script below is intended to monitor the state of pin D22 and provide verbal feedback. When in Automatic Mode, ARC will control the wheels and all sensors. In manual Mode, a standard radio control transmitter will handle the wheel operations. I need this functionality implemented in both EZ-Script and JavaScript.
Here's my current EZ-Script code:
$X = GetDigital(D22)
if ($X = 0)
$X = "PASS"
EzbSay("in manual Mode")
elseif ($X = 1)
$X = "FAIL"
EzbSay("in Automatic Mode")
endif
Could you review it and help me ensure that it performs correctly? Additionally, guidance on translating this into JavaScript for the ARC environment would be greatly appreciated. Thank you!

I trid the new ezscript, this is the error message I get :
Start Error on line 8: Missing String Quotes or Invalid Expression at index 4: > Done (00:00:00.0156305)
it never goes beyond that point
Thanks - that error came from an invalid comparison expression. The line If($Last 0) is missing a comparison operator, which causes the "Missing String Quotes or Invalid Expression" error.
EZScript implementations differ slightly on the notequal operator. Try the corrected script below - first with the VB-style operator <> (most common in ARC EZScript). If your ARC version still errors, try the second variant using != (C-style).
Paste one of these into the Script skill EZScript tab and Start.
Notes & troubleshooting:
Would you like me to:
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
just as an fyi, athena doesn't know ezscript - which is why she will keep pushing javascript or python onto you
. So unless you enjoy talking to her like this, she'll keep making mistakes for ever haha
Thanks - good point, DJ_Sures. Appreciate the callout.
A few clarifications for everyone here:
If you want, I can:
Helpful links:
RoboHappy - which would you like now?
If you want the JS again, I’ll paste the tested version (with the C3 beep) ready to paste into the Script skill.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
DJ,
Thats too bad, She should learn it, it would be helpful for some of us that are old school
Ive never liked java or python. Im still a fan of BASIC any day of the week lol. That said, I do like how she was able to create the java version so fast, and it does work. I have another ezscript id like to see it converted to JC, just curious to see what happens
Athena I am happy with your last JS, it works, so I am deciding to use it as is. This will be used as part of an update process im doing of an old robot I posted on long time ago. Id like to post a small video of the script in action if I can here.
Nice - glad the JS is working well and you’re happy with the tone. Posting a short demo video is a great idea. Below I’ll give clear, practical steps for recording, uploading, and sharing your clip on the Synthiam Community (and best-practices so viewers quickly see the important bits). When you’re ready, paste the next EZScript you want converted and I’ll convert it to JavaScript for you.
How to record a short demo
Quick recording tools
Uploading the video
How to post on Synthiam Community
Helpful debugging & posting tips
Would you like:
I’m ready to convert your next EZScript whenever you paste it here - and I can even prepare a short "what to show" checklist tailored to your robot for the video.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
athena Im suddenly having an odd issue with the JC. Once I click on START, the EZB will disconnect a few moments later. It happens so fast,the program hardly has time to announce which mode it is in. I then try to reconnect to the EZB, script still running, switch mode on transmitter, still disconnects. Does not seem to disconnect EZB if I dont run the script. Very odd all of the sudden. I may have ti go back to a previous SC you created and see if this still happens.
Thanks - that’s a useful symptom. When a script causes an EZ-B to disconnect shortly after Start, it’s almost always one of a few common problems (power draw / brown-out, WiFi instability, or the script flooding the EZB with too many commands). Let’s go through a targeted troubleshooting checklist and a safer JavaScript you can run that minimizes traffic to the EZB and detects disconnects.
First, quick checklist (try in this order)
Connection type
Power / brownout check
Camera / other devices
I2C and peripherals
Script behavior to review
Connection diagnostics / logs
Useful docs
Safer JavaScript to run now
Testing steps with this code
Extra safety options I can add
Questions for you
If you paste your current JavaScript (the version you were running when disconnects happened), I’ll review it and point out any lines likely to flood the EZB and provide a safer one-to-one replacement.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.