Welcome to Micro:bit expansion board repository


Micro-bit breakout manual

Front:

展示图 01.jpg

Back: line patrol, motor interface and magic sticker


1、RGB search light

image.png

1-1  Position

image.pngimage.png

1-2 Schematic diagram

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

IO port:IIC PCA9685 control

R: Channel 0

G: Channel 1

B: Channel 2

Block

image.png

1-3 Block

image.png

Choose the normal color directly

image.png

Choose different RGB color as your thought

Range(0-225)


2、RGB flowing light

image.png

2-1 Position

image.png

2-2 Schematic diagram

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

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.


3、Infrared obstacle avoidance or following

image.png

3-1 Position

image.png

3-2 Schematic diagram

NoteBy 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.

Hardware IO:

Transmitter IO:P9  Infrared emission at low leve ;Transmission closed at high level.

Receiver IO:P3  Obstacle detected at low level;No obstacle was detected at high level.

image.png

3-3 Block

Explaination: This block returns True or False. If it satisfies the description of blocks, it returns True; otherwise, it returns Fasle.

FunctionIt can be used to avoid obstacles and follow.


4、Tracking Sensor

image.png

4-1 Position

image.png

4-2 Schematic diagram

NoteThe 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.

Explaination IO:

Right probe IO:P1   The black line output low level is detected, and the L8 light will be on, indicating the black line is detected.

Left probe IO:P2   The black line output low level is detected, and the L9 light will be on, indicating the black line is detected.

image.png

4-3 Block

Explaination This block returns True or False. If it satisfies the description of blocks, it returns True; otherwise, it returns Fasle.

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 portP0

image.png

5-3 Block-1

image.png

5-4 Block-2

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


6、Infrared remote control

image.png

6-1 Position

image.png

6-2 Schematic diagram

NoteThis function is achieved by our remote control.

IO portP8

image.png

6-3 Block

Note:When using infrared remote control, you first need to configure the infrared receiver IO port, as shown below, can be executed at boot time, and then call the infrared remote event function, you can select all buttons corresponding to the event, then you can 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

7-2 Schematic diagram

Note:Ultrasound 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

image.png

7-3 Block-1

Note:This is a packaged block. The IO port has been written in the library. Here, 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.png

8-2 Schematic diagram

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

IO portThe 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

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.pngimage.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

image.png

9-3 Block

Note:Explanation for three blocks:

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.


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

Loading...