
Taubore
Canada
Asked

Could someone help me understand why I am getting this exception with the Wheel Encoder Counter skill?
I uploaded the firmware DJ's UNO Firmware with Wheel Encoder Counter (Feb 8, 2019) on my Arduino UNO from this link: Arduino Uno Firmware by following the steps in this tutorial: Connecting Arduino to ARC.
I connected the wheel encoders to port D2 and D3 on the UNO.
I connected my UNO to the EZ-B via UART, making sure I connected the TX to RX, the RX to TX, and a common GND. I also provided 5V for the UNO.
Despite this, I get the following error:
System.Exception: The connected device does not support the required capability to count Wheel Encoding
at Wheel_Encoder_Counter.FormMain.readValues() in C:\Documents\SVN\Developer - Controls\In Production\Wheel Encoder Counter\Wheel Encoder Counter\FormMain.cs
Did I miss something? Do you have any idea what I might have done wrong?
Note: I tried the following baud rates in the .INO file: EZ-Genuino_Wheel_Encoder_Uno.ino
#define _BAUD_RATE 57600 // Original
#define _BAUD_RATE 115200
#define _BAUD_RATE 9600
Related Hardware EZ-B v4
That would be really good, yes, i would like to try it. Thank you!!
Okay let me whip something up for you to try. Stay tuned
@athena, the code in the wheel encoder robot skill to query the values is...
That code only works when the controller is connected to ARC directly over USB. However, Taubore wants to communicate with that controller over the EZB UART. That means the JavaScript UART commands must be used to perform the same function. The BAUD Rate for the EZB UART will need to be 57600 , as that's what is configured in the Arduino firmware that the EZB will be communicating with. Place the EZB UART Init in the connection robot skill script so it only happens upon connection to an ezb. That way, it doesn't reinit the EZB uart for every query. The send commands 0x04, 0x00, 0x00, and the response will be in a separate "script" robot skill that can run in a loop with a slight delay.
Can you rewrite that code using the ARC javascript UART commands?
@Taubore, you will need to connect the Arduino's RX and TX to the EZB's UART. Remember to connect the RX to the TX and the TX to the RX. Also, the GND needs to be common across the EZB and Arduino.
Sure, I can help with that! Let's break down the steps to achieve this:
Step 1: Initialize the UART on EZ-B
Add the following script to the connection script of your EZ-B:
Step 2: Send Commands and Read Response
Create a new script in the Script Collection to handle sending commands and reading responses. Here’s an example script:
Step 3: Connect the Hardware
Ensure the hardware connections are correct:
Putting It All Together
Example of Connection Script
Example of Script Collection Script
Running the Script
This setup should help you query the wheel encoder values from the Arduino via the EZ-B UART. If you encounter any issues, feel free to ask for further assistance!
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.
Great! Thank you!