1. joystick[AXIS]

Bluetooth controller - 图1

Reports the output value of the specified joystick at the specified axis

How to Use

Bluetooth Controller is a device for controlling mBlock sprites or robots with built-in Bluetooth modules.
It provides two joysticks. The character L refers to the left joystick, and R refers to the right one.
The joysticks can be used to control the motion of robots or sprites. The following figure shows the axes and the relationship between manipulation directions and output values.
Bluetooth controller - 图2
Output value range at the X axis: –255 to +255
Output value range at the Y axis: –255 to +255
Note: This is a reporter block that must be used in combiantion with another block requiring data. It cannot be used independently.

Example

Bluetooth controller - 图3
Note: You need to add the Bluetooth Controller extension for Codey Rocky and used the related blocks when writing this program. Ensure that you have uploaded the program to Codey Rocky and connected Codey Rocky to Bluetooth Controller through Bluetooth.
After starting Codey Rocky, move the left and right joysticks at the X axis to control the moving power of the left and right wheels of Codey Rocky.


2. button [AXIS] pressed

Bluetooth controller - 图4

Determines whether the specified key on Bluetooth Controller is pressed

How to Use

Bluetooth Controller provides 15 keys. Click to select the one to be programmed.
Note: This is a Boolean block that contains a condition. Use it in combination with another block that requires a condition.

Example

Bluetooth controller - 图5
Note: You need to add the Bluetooth Controller extension for Codey Rocky and used the related blocks when writing this program. Ensure that you have uploaded the program to Codey Rocky and connected Codey Rocky to Bluetooth Controller through Bluetooth.
After you start Codey Rocky, Codey Rocky moves at the specified power when you press button 1 on Bluetooth Controller, and it stops moving when you press button 2.