Asked — Edited

Can Someone Help Me With The Development Of A ARC Skill?

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.


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Canada
#1  

Hello! As a robot support technician for Synthiam, I am not able to provide programming or code development services. However, I can suggest that you try posting your question in the Synthiam community forum or checking out the support section on the Synthiam website. There may be other users or resources available that can assist you with your project. Additionally, you may want to try reaching out to a freelance programmer or developer for 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.
#2  

Hey Smiller29, what language are you writing this ARC skill in? I've never written a Skill so I don't think I can help. All I know is EZ-Script and a little JavaScript. Sorry. I hope you do find someone to help because this sounds like a great skill to have available.

#3  

Dave,  It is an Arduino script that needs to send values back to ARC.  I think this can be done but not 100% sure.

#4  

OK this is for anyone that is willing to help.   The below shows a section of code in the ARDUINO firmware that I want to send to the ARC skill.

The below code is from the end of the doEZProtocol function within the firmware.

    // ------------ UART #2 (i.e. dummy)
    if (cmd2 == CmdV4UARTExpansion2Init) {

      Read32();
    } else if (cmd2 == CmdV4UARTExpansion2Write) {

      uint16_t length = Read16();

      for (uint16_t x = 0; x < length; x++)
        ReadByte();
    } else if (cmd2 == CmdV4UARTExpansion2AvailableBytes) {

      Write16(0);
    } else if (cmd2 == CmdV4UARTExpansion2Read) {

      uint16_t length = Read16();

      for (uint16_t x = 0; x < length; x++)
        COMMUNICATION_PORT.write((byte)0);
        
    } else if (cmd == CmdOurCustomCmds) {

      Write16(AngleZ);
      Write16(AngleY);
      Write16(AngleX);
      Write16(servoRvalue);
      Write16(servoPvalue);
      Write16(servoYvalue);

    }
  }
}

If someone could help me by providing me section of VS code that can read those last 6 values it would be a huge help.  I really need this solution for my project.

I think the code is going to kind be like the following but I need someone to help fill in the gaps.   I know if I can get a little more insight about how this IDE and how and what ARC needs I can get over this hump.

void readValues() {

      try {

        var response = EZBManager.EZBs[0].SendCommandData(4, 0x00, 0x00);

        UInt16 AngleZ = BitConverter.ToUInt16(response, ???);
        UInt16 AngleY = BitConverter.ToUInt16(response, ???);
        UInt16 AngleX = BitConverter.ToUInt16(response, ???);
        UInt16 servoRvalue = BitConverter.ToUInt16(response, ???);
        UInt16 servoPvalue = BitConverter.ToUInt16(response, ???);
        UInt16 servoYvalue = BitConverter.ToUInt16(response, ???);

        ARC.Scripting.VariableManager.SetVariable("$AngleZ", AngleZ);
        ARC.Scripting.VariableManager.SetVariable("$AngleY", AngleY);
        ARC.Scripting.VariableManager.SetVariable("$AngleX", AngleX);
        ARC.Scripting.VariableManager.SetVariable("$servoRvalue", servoRvalue);
        ARC.Scripting.VariableManager.SetVariable("$servoPvalue", servoPvalue);
        ARC.Scripting.VariableManager.SetVariable("$servoYvalue", servoYvalue);

        if (Invokers.GetCheckedValue(cbDebug))
          Invokers.SetAppendText(textBox1, true, "AngleZ: {0}, AngleY: {1}", AngleZ, AngleY ............................);
      } catch (Exception ex) {

        Invokers.SetAppendText(textBox1, true, ex.ToString());
      }
    }
#5  

Hey Smiller29. If you don't get a response maybe try contacting Synthiam' s customer support. I was stuck on some code a few months ago and I asked them for some help. The next day I had an answer and enough info to send me in the right direction. You probably already know this but as a Pro Subscriber you get one support ticket a month free. Any more has a small price tag. Perhaps spending a couple of bucks to get some peace of mind and knowledge may be worth the price? Your call.

#6  

@Dave,  Well it may come to that but I was trying not to have to call because it would be hard to explain this on the phone.  What complicates this is my lack of knowledge of this platform and coding. I have been a developer in a past life a long time ago using different tools and coding languages so this is all new to me. But I know if I can get through one of these skill development I will be able to continue to gain more understanding of how all this works.  I want to be in a position that if I have a limitation in ARC I can create my own skills to get around it if needed.

But I may give a call soon if I get no feedback from Synthiam or anyone else.

PRO
Synthiam
#7  

What else is the Arduino doing? I don’t think it needs to be an ezb firmware. Might be easier to just get the data directly from using the Serial class in c#

just have the Arduino loop and wait for a request, and respond with the 3 datas. Something like that.

PRO
Synthiam
#8   — Edited

Actually looking at your code - i have a ton of questions because you are "kind of" there if you're trying to make a firmware.

What data types are Anglez, etc? Because you're using Write16 so i'd expect them to be uint16_t (because you're also converting the value to uint16_t in the c# bitconverter)


    } else if (cmd == CmdOurCustomCmds) {

      Write16(AngleZ);
      Write16(AngleY);
      Write16(AngleX);
      Write16(servoRvalue);
      Write16(servoPvalue);
      Write16(servoYvalue);

Why are you expecting 4 bytes when your arduino code is sending at 12 bytes?


  var response = EZBManager.EZBs[0].SendCommandData(4, 0x00, 0x00);

You're sending.... (0x00, 0x00)


var response = EZBManager.EZBs[0].SendCommandData(4, 0x00, 0x00);

But your arduino code is only looking for (0x00)...


} else if (cmd == CmdOurCustomCmds) {

You can't use ??? as a variable name. You'll need to use a constant to specify where the index will start to read the uint16_t (microsoft has good manuals for c#: https://learn.microsoft.com/en-us/dotnet/api/system.bitconverter.touint16)


        UInt16 AngleZ = BitConverter.ToUInt16(response, ???);
        UInt16 AngleY = BitConverter.ToUInt16(response, ???);
        UInt16 AngleX = BitConverter.ToUInt16(response, ???);
        UInt16 servoRvalue = BitConverter.ToUInt16(response, ???);
        UInt16 servoPvalue = BitConverter.ToUInt16(response, ???);
        UInt16 servoYvalue = BitConverter.ToUInt16(response, ???);