Asked
Is it possible to access analog values on an Arduino using the existing ARC software? I've tried, but it seems that the only ADC (Analog-to-Digital Converter) skills available are tied to the EZ-Robot EZ-B v4 and EZ-Robot EZ-B Tiny controllers. I have several Arduinos that I'm already using with the Stepper servo skill, and they have extra pins available for analog inputs and outputs. However, I do not know how to access these analog values through ARC. If this functionality is not currently available, could you please consider adding it to the list for future skill development?
Related Hardware Arduino Genuino Uno
Yes, you can access the analog values on an Arduino using the existing ARC software. The key is to use the I2C communication protocol to read the analog values from the Arduino. Here's how you can achieve this:
Using the PWM servo Feedback (i2c) Skill
The PWM servo Feedback (i2c) skill is designed to read analog values from an Arduino over I2C. Here’s a step-by-step guide to set it up:
Upload the Firmware to Arduino:
Connect the Arduino to EZ-B:
Configure the PWM servo Feedback (i2c) Skill:
Read the Analog Values:
Using Custom JavaScript or Python Code
If you prefer to write custom code, you can use JavaScript or Python in ARC to read the analog values from the Arduino over I2C. Here’s an example using JavaScript:
Initialize the I2C Communication:
Read Analog Values:
Using the ArduinoComs Skill
The ArduinoComs skill allows communication between the EZ-B and Arduino using I2C. You can use this skill to send custom commands to the Arduino and read the analog values. Here’s how:
Upload Custom Firmware to Arduino:
Configure the ArduinoComs Skill:
Send Commands and Read Values:
Example Arduino Firmware
Here’s an example of Arduino firmware to read an analog value and send it over I2C:
Conclusion
By using the PWM servo Feedback (i2c) skill, custom JavaScript or Python code, or the ArduinoComs skill, you can access the analog values on an Arduino and integrate them into your ARC project. If you need further assistance or have specific requirements, feel free to ask!
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 do not foresee myself using this process to get analog values. It would be much easier if you could just pick a different board for analog input similar to how you can pick different board for digital outputs.
Arduino supports adc - there is no limitation of adc on ardunio vs ezrobot controllers. The ports are labeled the same as ADCx
Athenas response is a little off because the question isn’t clear as to why you believe you cannot use adc ports on arduino.
Ok can you show me how to get to it. I only see the 7 typical ports listed. What if you have an EZ tiny and other Arduino boards how will it know which Arduino board? It only pulls up the four typical boards.
For that robot skill, it appears that you select the board index - which is the ezb board, corresponding to the connection index.
Isn't the board index specific to EZ boards. I did look into the board index but did not think that is correct. I have multiple ez boards and multiple Arduinos with same board numbers, how will it know the difference? See the dilemma? For instance Arduino Mega is always board 1 or business id 1 when using Stepper servo skill and will have EZ board 1 with the tiny but it only has 3 analog inputs. Have a feeling this might be a feature request for the next update.
What support is saying is the board index matches the connection index.
An EZB is an EZB. It can be an Arduino or any microcontroller with EZB firmware. It's the firmware that makes a microcontroller an EZB. Read here or watch a video from here: https://synthiam.com/Support/Get-Started/how-to-make-a-robot/EZB
So, if you have an Arduino with an EZB firmware connected on index 2, select 2 in that dropdown.
Also, you can make sure an EZB firmware supports ADC by checking the list of capabilities when it connects. For example here's when i connected to an EZ-Robot EZB v4.x/2
Ok I'm kind of digesting the info. The question now is since the Arduino was loaded with the Stepper servo firmware did it go into utilizing just pin 2 and 3 for step and direction, pin 6 for calibrating . Wouldn't that have to have more programing for the analog and other output pins. Or is that somewhat of a given that it will be available? Will dig in to what it's available capabilities are available as you have suggested above.
The stepper firmware is not an ezb. The stepper protocol does not support anything like reading ADC. So no, you wouldn't get an Arduino's adc value from a stepper motor firmware. You couldn't add it either because the protocol doesn't allow it. An Arduino would need an EZB firmware installed to operate EZB commands, not a stepper firmware.
Understood, had a feeling that might be the case. I'll just use the EZB-4.