SPACE CADETS
Robot Arm
ELECTRONICS �&�CODING
This motor controller can drive 16 servos!
This is the brain - we will use it to control the motor driver and other interfaces.
Connect the brain to laptop for power - you should see the red LED turn on.
Reset Button
Concept
Model
First let’s make sure we can control the brain…
http://a9i.sg/ioty ��This is the coding environment
FLASHING
FLASHING - Setup Brain for IoTy
Click on either Connect buttons and find an active, connected COM Port
If you don’t see a COM port in the window, check your brain is connected via USB and call the teacher!
1.
2.
Enter “ioty- <Student #>” assigned by coach
Before you press Flash, reset IoTy once - �click on left/EN/Reset button on Brain
Each time you reset after you successfully flash, you should see Blue LED flash 3 times.
Then will start to blink…
Reset Button
CONNECT TO PC
BASIC CODING
Press the 3 vertical dots, and choose “Connection Mode”. Inside, pick Serial.
Press the 3 vertical dots, and choose “Connect (Serial)”. Choose COM port of brain.
Let’s see if we are connected�Switch to Monitor tab, and reset Brain
You should see this. Almost…
In a bit we will type some python instructions.
First, let’s write the block code to get an idea…
Pin 2 - controls Blue LED
1 means ON
0 means OFF
Download to Device…
Reset Device…
Now paste the last line and hit ENTER -
This should turn on Pin 2 on the brain.
You should see the blue LED turn on!
Can you figure out what to type to turn it off?
MOTOR CONTROLLER
Brain | Motor Controller |
3V3 | VCC |
VIN | V+ |
GND | GND |
D18 | SCL |
D19 | SDA |
CONNECTIONS
Now let’s write the code that sets up the motor controller system.
Now let’s write the code that sets up the motor controller system.
Blocks from I2C and PCA-9685 block tabs
Blocks from I2C and PCA-9685 block tabs
And use these instructions to test Robot Arm:
pca9685_device.servo_deg(Ch, Degrees)
Ch = 0, 2, 4 or 6
Degrees = 0 to 180
Connect each of the 4 servos to a channel:
0(base), 2(left), 4(right), 6(claw)
Make sure not to stress motors to impossible positions!
ROBOT ARM�CHALLENGES
How hard is it to use coding instructions to: