双轴按键摇杆模块用于控制机器人,舵机,马达的运动方向.
Connecting a Grove - ThumbJoystick to Microbit is a bit tricky, but it is worth doing. So let's go!!
Firstly, we need to prepare a Micro:bit, a Grove shield, a tweezers(or needle), a scissors, a Grove - Thumb Joystick, and a Grove - Branch Cable.
It is very very important to pay attention when using scissors and tweezers!
As the pictures shown, the Grove - Branch Cable has 3 connectors. We name them Conector#1
, Conector#2
and Conector#3
. Note that Conector#2
and Conector#3
have no differences at first.
Then carefully pick the white cable out of Conector#2
with a tweezers(or needle).
Carefully pick the yellow cable and white cable out of Conector#3
with a tweezers(or needle).
Be careful not to cut the wrong cable!!!
Cut the white cable of Conector#2
and the yellow cable of Conector#3
.
Insert the white cable to the first slot of Conector#3
as the picture shown.
Almost done!
Now we connect Conector#2
to P0/P14
port and Conector#3
to P1/P15
port of Grove shield.
The last step! We connect Conector#1
to Grove - Thumb Joystick and finish!
Now let me show you how to program in Makecode.
After adding this package to Makecode, we can find a block named "on Key Up/Down/..". This block is similar to the base block "on button A/B pressed", it means if the key is at "Up" status, an event handler is started.
This is an example of showing some arrows when Grove - Thumb Joystick is manipulated.
MIT