15. Case 14: Remote Control with Joystick:bit¶
15.4. Programming¶
Click “Advanced” to see more choices in the MakeCode drawer.
We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “tpbot” in the dialogue box to download it.
We need to add a package for programming the Joystick also. Click “Extensions” in the bottom of the drawer and seach with “joystick” in the dialogue box to download it.
##Sample
Remote Control Part¶
Set the radio group as 1.
Judge the value of x&y of the Joystick in the forever brick, if the value of the x is below 200, radio send number 4; if the value of the x is over 800, radio send number 3; if the value of the y is below 200, radio send number 2; if the value of the y over 800, radio send number 1; or radio send number 0.
Link¶
You may also download it directly below:
Link¶
You may also download it dorectly below:
The movement of the TPBot is controlled via the Joystick:bit.
15.5. Exploration¶
15.6. FAQ¶
Q: The car does not work with the code in the wiki.
A: It should be the batteries that are lack of power, please try to fix it by adding the value of the speed in the code.