
PRO
smiller29
USA
Asked
— Edited
Can someone help me with the development of a ARC skill? I have put together a Arduino script that is for an ESP32 it contains the EZB firmware and it also has a very robust MPU6050 logic. I need to have the skill in ARC be able to allow some options to be set and also bring MPU data back in variables. Like I said I have all the logic I just need help making the UI for ARC.
If you are willing to help let me know and I will send you the code.
I think what you want in arduino, given that you're missing a ton of code that explains what the variables are, is this...
And in C# would be...
@ DJ, The ESP32 is a wifi based EZB using this modified firmware so it has all those feature plus the MPU6050 code. My goal is to find the easiest way to get those MPU6050 values back to ARC as global var's so I can use them in other ARC skills. My understanding reading another post here the ARC polls the EZB firmware so I figured I would add the MPU6050 processing as part of that control loop. But please if there is another way please help me because I really need to be able to get these MPU values back to ARC.
I gave you examples above. Also there's this example in the support section: https://synthiam.com/Support/Create-Robot-Skill/Examples/extend-ezb-protocol-with-custom-command
DJ, Thank you! I will review what you posted and also try to answer your above questions. The code I posted was just a draft based on other code I found, the ??? we’re just place holders.
I don’t have access to the Arduino code right now but if I remember right those values are unsigned int and int.
Update below:
DJ, I know your busy but if you get a free min can you review this code and let me know if this ok?
EZ_ESP32_MPU6050.zip
The data from the compass is a float
which you're assigning to an unsigned int. I assume the unsigned int of esp32 is 16 bit
Without knowing what that data from the mpu is, you will have to convert it to an int. The project as is will work, but the value will be truncated from a float to an int. So if it's a floating point between -1 and 1, you will only get a -1, 0, or 1. You can always multiply the float by 100 or 1000 to get an int and remove the decimal.
Float over serial is difficult, doubly so between cpus (esp vs x86). They're not compatible, so you'd need to either multiple before sending and divide on receive.
But your firmware looks like it'll work with the example robot skill code i provided you
DJ, Thanks I will make the changes you recommend to the firmware make everything an integer. My other problem because of my lack of understanding the VS IDE is where to put the code because it auto creates so much stuff for you I am just not sure where stuff goes.
I made a few changes to the code you provided is what I came up with. Note: IT DOES WORK SO I AM MISSING SOMETHING....
No where are you calling the readValues() function. It’s just sitting there. Put it in a button for testing. After that you’ll probably want it in some sort of timer.