Proteus
Portugal
Asked
— Edited
Resolved by DJ Sures!
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
Here ya go...
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.
Ok, thanks DJ. I am on the beach right now. When I get home I will continue and let you know.
Lucky dog! How’s the beach?
My youngest son says the water is warm...
Looks wonderful! We’re all jealous
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.
On the plugin side I read the "Temp" value like this:
How can I get decimal numbers?
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
Closed. Thanks DJ!