Hi @Athena,
I’m looking for advice on translating a robot skill script for an ARC project. My objective is to convert a robot skill written in ARC JavaScript into code that will run on a Teensy 4.1. I plan to develop the code in the Arduino IDE (Arduino C++ or another language supported by the Teensy) and deploy it to the Teensy, which will be part of a rover. The rover also uses an Arduino Mega for the motors and an EZB that is currently running Synthiam firmware and connected to ARC with JavaScript Robot Skills.
My specific question:
- Will the AI assistant that I can access from within my robot skill (the skill that contains the ARC JavaScript to be translated) be able to translate the ARC JavaScript into a language that will compile and run on the Teensy 4.1?
Notes and clarifications that might help:
- I’m open to using a language other than Arduino C++ if it’s suitable for the Teensy.
- I’m not yet sure whether the Teensy will act as an EZB-compatible controller (running Synthiam firmware) or whether it will be connected as a separate microcontroller in the system. If that matters, I can clarify the intended hardware topology - specifically how the Teensy, the Arduino Mega, and the EZB will be connected within the ARC project (directly to ARC/PC, via EZB, UART/I2C between boards, etc.).
Any suggestions on a path forward? Thank you.
- Jack

Yes - the ARC AI Assistant can help translate ARC JavaScript logic, but it cannot directly generate a Teensy-ready firmware solution by itself with guaranteed hardware correctness.
The important distinction
ARC JavaScript runs inside ARC and uses ARC APIs like:
Servo.setPosition(...)Movement.forward(...)Digital.set(...)Audio.say(...)A Teensy 4.1 program, on the other hand, runs on the microcontroller itself and uses:
So the AI Assistant can usually help you:
But it won’t magically know your Teensy hardware design, pin map, sensor libraries, or whether the Teensy should replace an EZB-compatible controller.
Best path forward
For your rover, there are really two different translation goals:
1. Convert ARC JavaScript into Teensy firmware logic
This is feasible if the script is mostly:
In that case, the best result is usually:
2. Keep ARC as the high-level brain
This is often the better architecture if ARC already works well.
For example:
That avoids trying to fully "port" ARC robot behavior into embedded firmware when ARC is already good at that job.
My recommendation
If your goal is to move the logic off ARC and onto the Teensy, then:
About the AI Assistant in ARC
The AI Assistant inside ARC is very useful for this kind of work, but the best workflow is:
You can also use the ARC AI Assistant to help convert from ARC script into a hardware-neutral logic outline first, which is often safer than going straight to final firmware.
What matters most: your system topology
Your note about not yet knowing whether the Teensy will act as:
is exactly the key decision.
If Teensy becomes an EZB-style controller
Then ARC may be able to talk to it more directly depending on the firmware/interface approach.
If Teensy is separate
Then the cleanest approach is usually:
That is often the most robust design.
What I need from you to guide you properly
If you want, paste:
Then I can help you turn it into a Teensy-friendly Arduino C++ structure.
If you’d like, I can also help you design the best hardware/software split first, which is usually the smartest step before converting code.
Don't try to do what you're asking. You cannot run a script on a PC and expect it to run on an Arduino. An Arduino is not a PC. An Arduino has kilobytes of memory; a PC has gigabytes. The difference is substantial.
@Athena. To answer your questions and to provide more information to DJ. This is a rover robot containing a Teensy, a Mega, and an EZBv4. Synthiam ARC is running on the PC.
Your Questions:
My response:
I hope this helps in proceeding. Jack
JavaScript to be translated into Arduino C++
Thanks, that context helps a lot.
Short answer
No - the ARC AI Assistant cannot take that ARC JavaScript and produce something that will automatically compile and run on a Teensy 4.1 as-is.
It can help translate the logic into Teensy-friendly C++/Arduino code, but the result still needs to be treated as a manual port, not a direct conversion.
That’s the key distinction DJ is pointing at, and he’s correct:
you cannot run ARC script on the Teensy. You have to rewrite it for the Teensy’s environment.
What your script really is
Your script is not just "JavaScript."
It is:
Servo.setPosition()ADC.get()sleep()setVar()getVar()That means the good news is:
So this is a strong candidate for a rewrite into Teensy C++.
What should be translated
The proven approach is to translate it into:
millis()-based timinganalogRead()That is the correct embedded pattern for a Teensy.
Your current ARC structure is already close to a state machine, which is great. But the
sleep()and servo-position polling style should be replaced with timed transitions on the Teensy.Recommended architecture
Since your rover has:
the cleanest architecture is usually:
Option A - Teensy as a subordinate sensor processor
This is likely the best fit for your use case.
Option B - ARC remains the supervisor
That keeps the Teensy firmware small and maintainable.
What the AI Assistant can do well
Inside ARC, the AI Assistant can help you:
Servo.setPosition()with Teensy servo library callsADC.get()withanalogRead()sleep()withmillis()timingWhat it cannot do reliably by itself:
Better way to structure this
Your ARC script should be rewritten into something like this on the Teensy:
IDLENEG_SEARCH_INITNEG_SEARCH_FINALPOS_SEARCH_INITPOS_SEARCH_FINALSTOPPEDThen the Teensy loop checks:
That is the right embedded design.
Important note about your current code
Your posted ARC script contains some issues that should be fixed during translation:
So I would not do a line-for-line copy.
I would convert it into a clean embedded state machine first.
That is the proven better way.
What I recommend next
If you want, I can help you do one of these two things:
1. Convert this script into Teensy 4.1 Arduino C++
I can rewrite it into:
millis()logic2. Design the ARC EZB Teensy protocol first
This is often smarter if the rover is part of a larger ARC project.
I need one clarification
What is your final goal for this subsystem?
For example, do you want the Teensy to:
If you want, paste the full uncut script and I’ll help convert it into a proper Teensy 4.1 C++ sketch.
@Athena. Thank you for your input. I had no idea that ARC JavaScript would require such changes and not be more directly translatable into Arduino C++.
You wrote:
Recommended architecture
Since your rover has:
the cleanest architecture is usually:
Option A - Teensy as a subordinate sensor processor
This is likely the best fit for your use case.
I agree, let's do Option A.
You wrote:
What I recommend next
1. Convert this script into Teensy 4.1 Arduino C++
I can rewrite it into:
millis()logic2. Design the ARC EZB Teensy protocol first
This is often smarter if the rover is part of a larger ARC project.
Let's do #2 first and then follow up with #1. What is your final goal for this subsystem? ANSWER:
3. The Teensy will UART RECEIVE the following from the EZB:
That's it. A stand-alone servo/sensor sweeper that once it receives a START(OPERATION) from the EZB, will only send changed Actual Bearing updates. The Teensy will only STOP when a STOP(OPERATION) is received from the EZB. This STOP(OPERATION) from the EZB can be triggered by a condition detected on the Mega or by the TEENSY'S own detection of OBS or servo Runaway.
You wrote: If you want, paste the full uncut script and I’ll help convert it into a proper Teensy 4.1 C++ sketch.
Answer: Can you please convert the provided ARC JavaScript into a proper Teensy 4.1 C++ sketch? The only one I have was uploaded previously. I will post it below. Hopefully it will provide the clarity you need. Please be mindful that the logic in the following functions is very different from each other and all previous attempts to convert has resulted in them becoming practically the same.
Thank you for your continued support. Jack
ARC JAVASCRIPT
I can tell you why this isn't working out. You've posted about this script over 100 times in the last few weeks. But the thing is, you haven't ever defined "what the outcome is". You haven't told Athena what you're trying to do. You're just saying, "Here's some code; fix it." But "fix it" has no meaning because there's no idea of an objective.
Here's a better example. Imagine you invited me to your home and said "paint it"... Am i to paint the kitchen, the whole house? The floor? the inside, the outside, what am i painting? Sure, everyone knows how to paint, just like the AI knows how to code. But you haven't told it what to paint, what color to paint, etc...
The thing that might be limiting you is you. I know this sounds funny, but it's true, and it takes a bit of rewiring to understand. But here's what I'm trying to say: AI knows more than you, so don't assume you know more than it. What i mean by that is when you ask AI a question, don't assume you know what to do with the answer. Instead, don't treat AI as an answer-giving machine. Instead, treat AI as a "make _____ happen". Think of AI as a genie. Tell AI what you expect to happen, not how to do it.
So even I have no idea what it is you're trying to do with these code snippets. To anyone else, it's just random code with no defined outcome or purpose.
Here is my suggestion if you want to keep using AI to help you...
With either method, the AI will do it. It'll write the code, compile the code, install the code, make the project, etc... You just need to tell it what you want. Does that make sense?
These are two important reads that help you with talking to AI and giving it instructions
Hope those help!
That's correct - and since you are an ARC user, consider loading an AI agent on your computer. We recommend Claude.
By loading Claude on your computer, you can connect it to ARC using the latest release, which includes the MCP server.
That means the AI Agent can control ARC entirely. You can say...
^ you will need to provide more details about your robot, such as ports and stuff. Or you can not tell the AI and it'll tell you how to do it.
And the AI agent will make that happen entirely. You can grab a coffee, and when you get back, you may have custom robot skills made. You will have firmware made for the teensy, etc.. If you have the Teensy connected, it'll verify it compiles and upload it for you. It will download what it needs and make it all happen.
Thank you for your input. Jack