Make an ARC Skill

Add Some Buttons

Now that the MainForm has been created with the example project, it will be the form that users see when using your plugin. The form is currently only containing a label with some text, making it a boring skill. In this step we will add two buttons to move servos between different positions.

  1. Locate the MainForm in the Solution Explorer and double click.

    User-inserted image

  2. When the MainForm designer loads, click on the text and press Del to remove the label from the form. This will leave you with a blank form.

    User-inserted image

  3. Locate the Button under All Windows Forms in the Toolbox. Drag two buttons anywhere onto your MainForm.

    User-inserted image

  4. Give the buttons readable text that tells the user what they will do. In this tutorial example, we will be programming the buttons to move a servo between two positions. Click on each button and locate the Text field in the properties window.

    User-inserted image

  5. Double click on each button in the Designer and code will automatically be generated for the Click event of each button. This means that when a user clicks on the button, the code within the function will be executed. The functions are automatically inserted into your code when you double click on them from the designer.

    User-inserted image

  6. Insert code into each of the button click events to move a servo. The command to move a servo is located within an EZB class. Because ARC allows more than one EZB connection, the list of EZB's available is an array. It is safe to assume that the first EZB is used the most. Here is the code which will move the servo connected on the EZ-B port D0 between position 10 degrees and 170 degrees when the buttons are pressed.


    private void button1_Click(object sender, EventArgs e) {
      EZ_Builder.EZBManager.EZBs[0].Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D0, 10);
    }

    private void button2_Click(object sender, EventArgs e) {
      EZ_Builder.EZBManager.EZBs[0].Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.D0, 170);
    }

  1. When your code has been entered, it will now look like this.

    User-inserted image

  2. Let's compile your project to ensure there are no errors before continuing to the next step. Press CTRL-SHIFT-B and watch the Output window for any error messages. If everything compiles okay, you will see a similar message result to the screenshot below.

    User-inserted image

  3. Assuming you have no errors and everything compiles fine, press F5, the project will compile and load ARC. Add the robot skill plugin to your workspace and test it out!


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

United Kingdom
#1  

Is this out of date? There doesn't seem to be a GetConfiguration function within EZ_Builder.Config.Sub.PluginV1

PRO
Synthiam
#2  

Look at the tutorial step titled Code: Saving/Loading Configuration

The get and set configuration methods are overrides of the form. There’s a great video on the first step of this tutorial that demonstrates the step by step of building a plugin. I recommend watching that because it helps fill in any steps that were missed.

When you’ve done it once, it makes sense and voila, you can rinse and repeat:)

United Kingdom
#3  

Excellent, thanks - I will do. I really must learn not to just jump ahead in the process:)

PRO
Synthiam
#4  

Hey no problem - I do it all the time, and end up frustrated because I dont know what it was that I missed. Excitement gets the best of me

United Kingdom
#5  

Trying to follow the tutorials but can't find where the plugin page has gone. How do I add a new plugin to the ez-robot / Synthiam site to get the XML?

United Kingdom
#6  

Never mind. Just found the "Create skill control" link:)

#7  

I am trying to follow the instructions for adding my own plugin but I cannot seem to find the place to register the plugin based on the instructions.

Any help is appreciated.

Thanks

PRO
Synthiam
#8   — Edited

The new button to create a plugin skill control is less than an inch below the button you pressed to create this question. :)

User-inserted image