Indice degli argomenti
ACTIVITY DESCRIPTION
In the first part use mbot robot and Makeblock – Joystick to control the movement of robot. The joystick and robot are connected by a cable. The speed of the robot is determined by the joystick's deflection.
In the second part you controlle a prepared activity by joystick except mouse or keyboard – you will write the game.
FIRST VERSION
Me Joystick Module is used to control the moving direction of cart and the interactive video game. It has an analog port and should be connected to the port with black ID on mBot.
In neutral position X-Axis and Y-Axis give number 0, but it oscilate between -2 and 2. When you moves stick to other position number is changing. The minimum is -490, the maximum is 490.
Be careful about the value 490. When you push joystick to maximum position the value is 486-490, because it is analog value.
SECOND VERSION
Use joystick to control computer game.
To control the speed of robot we have to transform the analog values from interval (-490,490,) to digital from interval (-250,250).
We should use proportional and the linear function y = ax + b.
S4A is a Scratch modification that allows for simple programming of the Arduino open source hardware platform. It provides new blocks for managing sensors and actuators connected to Arduino. There is also a sensors report board similar to the PicoBoard one.
ACTIVITY RESOURCES
File: 2