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!

AThena
I ran the newest script. I like it. I also created the separate HB25 Init script and decided to add the startup on connection skill :
controlCommand("HB25 Init", "ScriptStart"); sleep(500); // wait a bit, or remove if you don't need a delay controlCommand("HB25_D22_Monitor", "ScriptStart");
Things work fine as long as the wifi stays connected. I have been having alot of disconnects tonight which might be a wifi dongle related.
Great - glad the startup sequence is working and you have the HB25 Init + monitor started from the Connection settings. Frequent WiFi disconnects are a common nuisance; here’s a practical troubleshooting checklist plus a ready-to-paste reconnection script (JavaScript) you can run as a small ARC Script skill to automatically recover, re-run HB25 Init, and restart your monitor when the EZ-B reconnects.
Quick checklist - common causes and fixes
Automatic reconnect script (JavaScript)
Paste-ready code:
How to use
Notes & tips
Follow-ups
Tell me how you’d like to proceed and I’ll give the exact code/config for that next step.
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 always run my all EZBs in AP mode.
I'm running ARC on a Dell Latitude 7390 with Windows 11(64bit), some disconnects actually freeze the ARC program and I use Task Manger to totally shut the program down and recycle power to the EZB (I Notice ARC is listed as ARC(32Bit), is this a problem?
I use both the internal Wifi and an external Wifi dongle to have internet access and connection to the EZB. My dongle is either the one that was supplied with my EZRobot InMoov Head kit or an X-Media NE-WN3201
I also get the disconnects even with just using the internal wifi (already checked that drivers are updated)
I would like to add that EZB Reconnect script and see what happens (adding a time stamp might be good idea too)
Nice details - thanks. Running the EZ-B in AP mode on a Windows 11 laptop with both internal WiFi and a USB dongle can work well, but the mix of adapters, power saving, and drivers is often the root cause of the disconnects you’re seeing. Below I give:
Short answers
Troubleshooting checklist (practical order)
Power and wiring first
Disable WiFi power saving & USB selective suspend (Windows)
Use a dedicated adapter for EZ-B AP
Drivers & firmware
Avoid adapter roaming & auto-channel switching
Check logs
Run ARC as Administrator for testing
Consider a hardware test
Reconnect script with timestamped logging Paste this into a new Script skill (Project Add robot skill Script), JavaScript tab. Name the skill "EZB_Reconnect" (or change hb25InitScriptName / monitorScriptName accordingly). This script will:
Important: Set logFile to a path your Windows account can write to. If you choose a folder that doesn’t exist, create it first or pick a user-writable location (e.g., C:\Users\Public).
How to autostart the reconnect script
If you already used Connection's Connection Established Scripts for HB25 Init + Monitor, you can instead call HB25 Init and Monitor from the EZB_Reconnect when reconnect happens (the code above already does that).
Next steps I can help with
Quick questions for you
If you want, I’ll:
Tell me which log path you prefer and whether you want $HB25Init cleared on disconnect - I’ll give you a personalized copy of the reconnect script with that setting and a one-line Connection setting you can paste into Connection -> Connection Established Scripts.
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
I ran the EZB reconnect scrpit but got this error:
This is what my connection skill scriptlooks like: controlCommand("EZB Reconnect Monitor ", "ScriptStart"); controlCommand("HB25 Init", "ScriptStartWait"); sleep(500); // wait a bit, or remove if you don't need a delay controlCommand("HB25_D22_Monitor", "ScriptStart");
Is this correct?
Correct me if I'm wrong, but are you sharing the IO between the ezb and rc servo controller when connected to the motor controller?
Because if so... when you are in RC mode, you're browning out the ezb and slowly damaging the io ports because the ezb io ports are either in a high or low state. There's no resistance on the voltage from the RC servo controller to the ezb IO ports.
And when you're in EZB mode, the RC controller is holding its IO high or low, and it's also straining the EZB IO.
You'd need either a multipoint relay to switch between the two controllers or a PCB of transistor logic.
Thanks - good info. Two separate issues here, so I’ll cover them clearly and give exact fixes you can paste.
Also check your Connection -> Connection Established Scripts lines. They run as EZ-Script (or the small control script area) so:
Correct text to paste into Connection -> Settings -> Connection Established Scripts (EZ-Script area):
Notes:
Why this happens:
Safe solutions (pick one based on convenience and hardware skill level):
A - Best and simplest: Hardware switching (recommended)
B - Electronic switch or tri-state buffer
C - Opto-isolation
D - Physical mechanical switch
E - Soft / software-only (not guaranteed safe by itself)
Practical protective additions (regardless of A-E)
Recommended approach for your setup
Script improvements to reduce risk (software side)
But, again - those lines alone do not protect hardware if the RC receiver remains connected to the same pins. Use hardware switching for safety.
Next steps I can help with
Questions for you so I can tailor the solution:
If you want the relay parts list and a wiring diagram I’ll provide a simple step-by-step and exactly where to wire grounds, signal, and control relay coil pins so it’s plug-and-play.
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,
This is the pololu r/c multiplexer switcher device, it is designed for you to control up to 4 servos between either of two separate R/C receivers ( or two EZB's even). I've used this product before.
I am only using two channels, the two HB25 M/C are connected to Out 1 and Out 2. S1 and S2 are connected to my EZB (D12,D13 for Automatic Mode) and M1 and M2 are are connected to channels 1 and 2 on a 2.4 R/C receiver (for manual Mode). Channel 5 on the receiver connects to the SEL pin, and is "Y"connected to a pololu pwm/digital output pin that goes "High" to D22 of the EZB on this project. on the R/C transmitter, flipping Ch5 switch allows me to disconnect drive motors from the EZB i/o pins and switch over to the R/C receiver to control the motors manually. Its not something I will always use but I want the choice and it will be the only r/c controlled feature on this robot. To power this board, I get that from the R/C receiver via the VS pins and I am not connecting this power to any EZB pins or m/c pins. The m/c is powered separately. So my R/c receiver is not directly connected and EZB I/O pins. I am aware i could use a relay to switch between the two but I found this alot cleaner solution for me and I wanted a way to tell ARC whats going on.
Athena On the JC code we have been working on, I see a "Servo. release()" in that last relay script you created, Would that be helpful on the other script? just a thought??