Portugal
Asked — Edited
Resolved Resolved by DJ Sures!

Arduino EZB Firmware To ARC Communication

I am trying to make a plugin. How can I send a non int number from arduino firmware to ARC plugin? For example, if I have the command "COMMUNICATION_PORT.write(Variable);" on the arduino side, what should the command be in visual studio to read the variable? DJ, could you publish the wheal encoder plugin on github? Thx


Related Hardware Arduino Genuino Uno
Related Control Wheel Encoder Counter

ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

PRO
Synthiam
#1   — Edited

Here ya go...

User-inserted image

The EZB protocol is synchronous and polled. So the robot skill plugin will need to poll the ezb for the data. You'll have to create a capability or re-use an existing one. This allows your firmware to be registered as a capability controller. Then on the robot skill side, simply poll/query the data from the EZB.

Check out the example of the wheel encoder and firmware - also here's the EZB communication protocol: https://synthiam.com/Support/EZB-Firmware/communication-protocol

Let me know if you have any questions - or tell me what you're desired outcome is and I'll direct you to the right places.

Portugal
#2  

Ok, thanks DJ. I am on the beach right now. When I get home I will continue and let you know.

PRO
Synthiam
#3  

Lucky dog! How’s the beach?

Portugal
#4  

User-inserted image My youngest son says the water is warm...

PRO
Synthiam
#5  

Looks wonderful! We’re all jealous

Portugal
#6  

Banging my head:( I am using this code on the Arduino to send a temperature value from the variable "Temp". The values are decimal, for example 22.03.

float Temp = dht.readTemperature();
 Write16(Temp);

On the plugin side I read the "Temp" value like this:

UInt16 Temp = BitConverter.ToUInt16(response, 0);

How can I get decimal numbers?

PRO
Synthiam
#7  

Floats are difficult to send cross platform without spending some time converting the correct bit length. It would be easiest to multiple the float by 100. That gives you two decimal places. That way you can send tbs value as an int16.

On the receiving end, get the response as an int16. Then divide the value by 10 and cast to a decimal, double or float.

I can write the code for you but I don’t want to give it all away until you’ve had a chance to try :)