Remote
Introduction
Joystick:bit V2 Plus is a game board based on micro:bit. It contains a 4-direction joystick and 4 undefined buttons. The Joystick:bit can also enhance game experiences with its onboard buzzer and vibration motor. Joystick:bit V2 can also be used as a remote control.
To Remote Control a Cutebot
Extensions - Software Programming
Click “Advanced” in the MakeCode to see more choices.
Next click "Extensions"
Type "joystickbit" within the search box.
This will display the "Joystickbit" Library that you can click on and install.
Next click "Extensions"
Type "cutebot" within the search box.
This will display the "cutebot" Library that you can click on and install.
Step 2: Joystick:bit Programming
Set “radio set group” to (1) in the "On start brick".
Set x to the map value given by “acceleration (mg) x” as shown below in the "forever brick".
Set y to the map value given by “acceleration (mg) y” as shown below in the "forever brick".
The scope of the acceleration value is 0~1024 , which can be regarded roughly as the speed value in 0~100 after dividing 10.
Upload the code to the Joysticks Micro:Bit!
Step 3: Cutebot Programming
Set the “radio set group” to (1) in the "On start brick". The radio set groups must be the same as the remote. If people are using more then one remote be sure to change the set group number by one to (2) then (3) and so on.
Drag two “if” bricks into the on radio received brick and judge if the radio revived value name is x or y
If the radio received value name is x, it is the data for X and then save the value in the variable xValue.
If the radio received value name is y, it is the data for y and then save the value in the variable yValue.
In forever brick, set the left wheel speed to yValue+xValue and right wheel speed to yValue-xValue.