Walkthrough - Making your first construct (Servos)
This tutorial will walk you through creating your first construct. We highly recommend that you take a look at the Sharing Robots Tour first if you have not done so yet.
Providing you are setup correctly, the tutorial should take you less than 15 minutes to create a construct that lets you and other web users control one or more servo motors. All without any computer programming.
You can either use your real devices or the built-in virtual devices for the walkthrough (see Glossary for explanation).
The tutorial will ask you to do the steps and then explain what you've done later. It's actually easier to do it than to tell you how to do it.
The basic steps of making a construct are:
Step 1: Create The New Construct and Establish Contact
Step 2: Choose a Control Panel
Step 3: Add new Actions
Step 4: Assign Actions to Buttons
Step 5: Preview your Construct
Step 6: Share with the world
Check that you have setup correctly and let's begin!
Step 1: Establish Contact - Link up your MakeAffinity client to the MakeAffinity website
You need to do this step just once for each new construct that you create.
At your MakeAffinity client:
a) Look for your Client Endpoint and Client Key. You will be copying them in the next section.
A Client Endpoint looks like this: fly.gateway.2wire.net:21000
A Client Key looks like this: C03C59E00B412F6D
At the website:
a) Create a new construct project:
Go to: Make -> Create New Construct
Type in a name in the Name box and click the Create button.
The system may ask you to enter a different name if what you entered is already used by another user.
The web page will now show your newly created construct in your list of constructs.
b) Enter your connection details:
From the list, select the construct that you have just created by clicking on Select.
Click on the Settings tab.
Copy or type in the client endpoint of your client to the website's Master Client Endpoint box.
Copy or type in the client key of your client to the website's Client Key box.
Click Save All at the bottom of the page.
The website can now communicate with your client.
|
Tip: MakeAffinity Client - The basics
The 'All Stop' button on the MakeAffinity Client will stop all device activity.
|
|
Tip: Making Constructs - The basics
Each construct consists of a control panel, the buttons of the control panel, and the actions that each button will trigger. Therefore, the typical steps for making a construct is to choose a control panel to use, specify the actions, and assign the actions to the buttons.
|
|
Tip: About the Action Editor (Make -> Actions tab)
The Action Editor will retrieve and display your supported devices. Creating a new action is simply a matter of choosing a device from the list of devices, setting the device action's properties, testing the action, giving the action a name, and saving the action. The following steps will show you how simple this is done.
|
|
Tip: About Servo Devices
A servo device may control 1 or more servo motors. Each motor is identified by its number. The main action properties of a servo device are the motor's number and the position (in degrees) you want the motor to turn to. Setting the position can be done in Absolute, Relative, or Relative-Advance modes.
In Absolute mode, the motor will turn to the actual degree that you set. E.g. the motor will turn to 120 degrees if you enter a value of 120.
In Relative mode, the motor will turn the number of degrees and in the direction that you choose from its current position.
In Relative-Advance mode, you can set the servo to turn continuously in the direction and speed that you choose.
Set these properties to create a servo action. The following steps will show you how.
|
Step 2: Choose a control panel
At the website:
a) Choose a control panel for this construct:
Click on the Control Panel tab.
At Use the following control panel for this construct, choose ServoTutorial.
Step 3: Add Actions
At the website:
a) Add an action that turns your servo motor to 160 degrees (Absolute mode):
Click on the Actions tab.
Click on the Add Action button.
Click on the Show My Devices button to show the Add Action dialog box.
Click on the Device dropdownlist and choose your servo device.
In Properties, choose a motor by its number (Motor No.).
Select Absolute mode and unselect Advance.
Enter 160 for Position.
Test the action by clicking the Test button and you should see your motor turn to 160 degrees.
Click the All Stop button on the MakeAffinity Client to turn the motor off.
Enter an Action Name (e.g. 'Servo160Degrees'), and click the Add button.
You will now see your new action listed on the Actions tab.
b) Add an action that turns your servo motor forward by 5 degrees (Relative mode):
Click on Add Action -> Show My Devices.
Click on the Device dropdownlist and choose the same servo device.
In Properties, choose the same motor number.
Select Relative mode and unselect Advance.
Select Forward direction and enter 5 for Move Degree.
Test the action by clicking the Test button. Your servo motor should turn forward 5 degrees each time you click Test.
Click the All Stop button on the MakeAffinity Client to turn the servo motor off.
Enter an Action Name (e.g. 'ServoForward5Degrees'), and click the Add button.
You will now see your new action listed on the Actions tab.
c) Add an action that turns your servo motor continuously in the reverse direction by 2 degrees (Relative-Advance mode):
Click on Add Action -> Show My Devices.
Click on the Device dropdownlist and choose the same servo device.
In the action's properties, choose the same motor number.
Select both Relative and Advance.
Select Reverse direction and enter 2 for Move Degree.
Select Medium in the Continuous dropdownlist.
Test the action by clicking the Test button. Your servo motor should glide in the reverse direction when you click Test.
Click the All Stop button on the MakeAffinity Client to turn the servo motor off.
Enter an Action Name (e.g. 'ServoGlideReverse2DegreesMediumSpeed'), and click the Add button.
You will now see your new action listed on the Actions tab.
d) Add an action that stops your servo motor:
Click on Add Action -> Show My Devices.
Click on the Device dropdownlist and choose the same servo device.
In the action's properties, choose the same motor number.
Select Relative mode and unselect Advance.
Select Forward direction and enter 1 for Move Degree.
Enter an Action Name (e.g. 'ServoStop'), and click the Add button.
You will now see your new action listed on the Actions tab.
e) At the Actions tab, you can test your actions directly from the actions list by clicking on Test.
Step 4: Assign Actions to Buttons
At the website:
a) Assign your actions to the buttons of the control panel:
Click on the Buttons tab.
Click on the Add Button Command button to display the Add Command dialog box.
Using the Button and Action dropdownlists, pair up your actions to your buttons and click Add.
Step 5: Preview your construct
At the website:
a) Now to see the final product:
Click on the Preview tab.
Click Start Preview to start playing with your construct.
Step 6: Share with the world (Optional)
At the website:
a) Let other web users play with your construct:
Click on the Settings tab.
Tick the Go Live! checkbox.
Click on Save All at the bottom of the Settings page.
Go to the MakeAffinity home page and click on Browse to search for your construct.
Click on it, book a time slot, and view it.
Ask your friends to use it from wherever they are too!
Add a web cam to your construct so others can see what they're doing! Here's how.
You are very much encouraged to try out other settings. The meanings of all settings can be found at the Glossary
End of tutorial