Exercises: Refer Datasheet For The List of Command/coding Function
Exercises: Refer Datasheet For The List of Command/coding Function
• While(1)
• If (!swf)
• {
Delay( 3000)
led1,led2,led3,led4,led5,led6,led7,led8
Exercise 3
• Define ccw and cw for the brushless motor.
• Build a function to brake and stop the motor.
- Brake, the motor will stop without inertia
- Stop, the motor will stop with inertia
• Build a function to insert speed value, the
function name should pwm1(int x) for
brushless 1 and pwm2(int x) for brushless 2
Exercise 3
• Create a function, rotate the motor that connected to
brushless 1 as ccw and motor that connected to
brushless 2 as cw, the motor need to move with given
condition for delay 300000.
• The speed of both motor are 150.
• When sw1 at main board is pressed, the above
function is called and it will brake when the function is
finished.
• When sw1 at control panel is pressed, the above
function is called and it will stop.
Exercise 3
• Lastly, please state the outcome of the robot if
motor that connected to brushless 1 are right
motor and brushless 2 are the left motor.
front
1p 1p 1p 3p 1p Obstacle
1p
Starting
point 1p -40p 20p -10p
PLEASE USE YOUR IMAGINATION
• The robot size is 250 encoder x 250 encoder
• The robot can start any where at the 4 box of the
starting point
• The game time is 3 minutes, when the motor
starts, the time starts.
• Gain as many point as you can, when you reach
the end point, your point are counted, if you
never arrive at the end point within this 3
minutes, you will earn 0.
Guide
• Use 24 volts, 2 brushless motor only.
• Use control panel, main board and the
brushless card.
• Assume encoder 50 will perform 90 degrees
turning.
• If finishing every task, your robot need to
brake automatically.
TASK
• BUILD A PROGRAM TO ENTER THE GAME.
• WHEN FINISH, CALL THE FACILITATOR TO
EVALUATE YOUR OUTPUT.
• USING CONTROL PANEL,WILL GET PLUS POINT.
• PLEASE DO THIS PROGRAM AND TEST RUN,
WITHIN 90 MINUTES.