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!
Related Hardware (view all EZB hardware)
Related Robot Skills (view all robot skills)

Athena, Im still doing some testing, but could you put back the LED for manual mode on D21 of your Robust EZB_D22 script? It always throws me off when it not on.
Perfect - I added D21 LED control to the robust EZB_D22 monitor so the LED turns ON when the robot is in manual mode and OFF when in Automatic mode. The script uses the existing ezbIndex and only writes D21 when the mode actually changes (to avoid repeated writes). It also sets the LED after reconnect settle/read so it matches the announced mode.
Paste this into your Script skill (JavaScript tab), save and Start it. If your Script skill has a different title, update skillTitle. If you want the LED behavior reversed (ON for Automatic), tell me and I’ll flip it.
Updated script (JavaScript)
Quick testing tips
Note about the LED logic
Next
Tell me which LED polarity or blink preference you want, and I’ll provide that tweak.
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.
Yes, I would like the LED on D21 to blink briefly when mode changes, and add the log file as you suggested.
Great - I added the blink-on-change behavior and a timestamped log file to the robust EZB_D22 monitor. Paste the script into a Script robot skill (JavaScript tab), save and Start it. The script will:
Important: put this code in the Script skill JavaScript tab (not EZ-Script). Update file path or ezbIndex if needed. If Windows permissions block file writes, change the logFile path to a writable folder (see notes below).
Script - paste into your Script skill JavaScript tab
Notes and troubleshooting
Follow-up
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.
I will have to look again to see if any log files were created, but so far in general things seem to be ok. D21 does blink as expected and is correct polarity to suite my needs at the moment (still testing...)
I need to build up the robot more, to properly test more functions of what I need , so to be continued ...
Nice - glad the LED blink and polarity are working so far. Below are small, safe utilities and options you can use while you continue testing. Paste any of these into a Script skill (JavaScript tab) or the Script Console to run them.
Notes & reminders
Helpful links
Next steps - what would you like me to do?
Tell me which option you want next, and whether you prefer daily logs or a single rotating file set (and the folder/path you'd like the logs placed in).
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.
Y999 Game in Pakistan also offers plenty of casual games in various categories of online games. These games bring the same gaming taste that you love to enjoy but this time it will involve real money earning. You can play 50+ casual games under casual game category of this real money earning app.
That looks like an off-topic promotion/post (not related to ARC or EZ-B v4). Please keep the thread focused on your ARC project so we can help you effectively.
If you (or jan756434) actually have a question about Synthiam ARC, EZ-B v4, the D22/D21 monitor, or the log file behavior, please post the exact question or the exact error/status text. I can help with:
Which of those would you like me to do next? If it’s the log check, tell me the log path you used (or confirm the default C:\Users\Public\Documents\ModeChanges.log) and I’ll give the exact snippet to run.
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.