Welcome to micro:bit expansion board repository


micro-bit breakout manual

Block package URL: https://github.com/lzty634158/yahboom_mbit_en

Front:

image.png 

Back: tracking sensor, motor interface and magic sticker

1.RGB search light

image.png 

1-1 Position

image.pngimage.png 

1-2 Schematic diagram

!!Note

The two RGB lights are connected in parallel, so the color is controlled at the same time.

IO portIIC PCA9685 control

R: Channel 0

G: Channel 1

B: Channel 2

Block

image.png

1-3 Block

Choose the normal color directly

image.png 

Choose different RGB color as your thought Range(0-225)

image.png 

Eg 1:

image.png 

Eg 2:

image.png 

Both of the above programming methods can make the RGB search light become red.

2.RGB flowing light

image.png 

2-1 Position

image.png 

image.png 

2-2 Schematic diagram

!!Note

This RGB light is made of three cascades, controlled the color of the three lights by one IO port. 

You can control them at the same time or control them separately and independently.

IO portP16

Block

image.png 

2-3 Block

This block is equivalent to the following block

image.png 

Specific use of this block method, please refer to the use of Neopixel library.

Eg 1

image.png 

Eg 2:

image.png 

Both of the above programming methods can make the RGB flowing light become red.

Eg 3:

image.png 

Eg 4:

image.png 

Both of the above programming methods can make the No.1 RGB flowing light become red, No.2 RGB flowing light become green, No.3 RGB flowing light become blue.

image.png 

3.Infrared obstacle avoidance or following

image.png 

3-1 Position

image.png 

3-2 Schematic diagram

!!Note:

By transmitting infrared radiation, when there is an obstacle in front of detection, the receiving tube receives the signal, and the level from high to low indicates that there is an obstacle detected.

IO port

Transmitter IOP9  

Infrared emission at low level; Transmission closed at high level.

Receiver IOP3  

Obstacle detected at low level; No obstacle was detected at high level.

Block

image.png 

3-3 Block

This block returns True or False.

If it satisfies the description of blocks, it returns True; otherwise, it returns False.

Function

It can be used to avoid obstacles and follow.

4.Tracking Sensor

 

 

image.png 

4-1 Position

image.png 

4-2 Schematic diagram

Note

The tracking sensor has the same principle as the obstacle avoidance sensor. Infrared returns to be received on the white line and is absorbed on the black line,detecting a low level. In this way, the difference between the two sides of detection can know which side of the car is offset, and the corresponding control car moves in the opposite direction to achieve the purpose of line inspection.

IO port

Right probe IOP1   

When the black line is detected, the L8 light will be on. Otherwise L8 light will be off.

Left probe IOP2   

When the black line is detected, the L9 light will be on. Otherwise L9 light will be off.

Block:

image.png 

4-3 Block

This block returns True or False.

If it satisfies the description of blocks, it returns True; otherwise, it returns False.

Function:

It can be used to track.

5. Buzzer

image.png 

5-1 Position

image.png 

5-2 Schematic diagram 

!!Note

The buzzer is a passive buzzer. It could plays music and sing.

IO port: P0

Block:

image.png 

5-3 Block-1

image.png 

5-4 Block-2

Note

“Block-1” and “Block-2” from official all could be used, because our hardware is consistent with the official IO port.

6. Infrared remote control

image.png 

6-1 Position

image.png 

6-2 Schematic diagram

!!Note

This function is achieved by our remote control.

IO portP8

Block:

image.png 

6-3 Block

!!Note

When using infrared remote control, you need to configure the infrared receiver IO port, can be executed at boot time.

Then you can call the infrared remote event function, you can select all buttons corresponding to the event, execute in each event any function you want to perform.

As shown in the figure below, configure the infrared receiver to be connected to the P8 port. When the remote control's Power button is pressed, the car searchlight will turn on red.

image.png 

6-4 Example

7. Ultrasonic

image.png 

7-1 Position

 

image.png 

image.png 

7-2 Schematic diagram

!!!Note

Ultrasonic module is an external module that can measure the distance in front of it to achieve obstacle avoidance and other functions.

IO port

Transmitter TrigSCL):P14

Receiver EchoSDA):P15

Block:

image.png 

7-3 Block-1

!!Note

This is a packaged block. The IO port has been written in the library.

The ultrasonic measurement distance (cm) is returned.

The distance can also be measured using the following position blocks, which is equivalent to the packaged block.

image.png 

7-4 Block-2

The effect of the two blocks is the same as shown in the figure below.

image.png 

image.png 

7-5 Example

8. Servo Function

image.png 

8-1 Position

image.pngimage.png 

8-2 Schematic diagram

!!!Note

The expansion board supports 3-channel servo and 3 - channel independent PWM output.

IO port

The PWM wave is output by IIC controlling the channel of PCA9685 chip.

S1 Servo ChannelJ2):Channel 3

S2 Servo ChannelJ3):Channel 4

S3 Servo ChannelJ4):Channel 5

 

PWM1L9):Channel 9

PWM2L10):Channel 10

PWM3L11):Channel 11

Block:

image.png 

8-3 Block

!!!Note

Three Numbers can be selected, corresponding to the extension screen printing J2, J3, J4, Angle range can be set 0-180 degrees.

 

9. Motor Function

image.png 

9-1 Position

image.png 

image.png 

9-2 Schematic diagram

!!! Note:

IIC drives PCA9685 channel output PWM for speed control.

IO port

Left motor AChannel 12

Left motor BChannel 13

 

Right motor AChannel 14

Right motor BChannel 15

Block:

image.png 

9-3 Block

The first is to control the motor direction, the default speed is the maximum;

The second is to set the speed of two motors at the same time and control the direction.

The third is not only to control the direction, but also set the speed of two motors separately.

 


Loading...