background image

6. MakeCode Graphical Programming 

 

How to use MakeCode: 

https://wiki.dfrobot.com/Makecode%20Get-started%20Tutorial

 

 

MakeCode Library Address

https://github.com/DFRobot/pxt-DFRobot_MaqueenPlus_v20

 

6.1 Light-controlled Maqueen Plus 

The following program calls the light sensor of the micro:bit motherboard. Normally, the car is 
in a stopped state, and the RGB light at the bottom lights up in color. When the flashlight 
illuminates the front side of the micro:bit, the car goes forward, the bottom RGB light goes out, 
and the front lights turn on. 

The value of the light sensor is an analog value between 0 and 255, which is used to indicate the 
intensity of light. In the program, we take a light intensity value of 100 as the demarcation point. 
When the light intensity is greater than 100, the car is started, otherwise, the car is stopped. 

Program Link: 

https://makecode.microbit.org/_26hJo3HLbaqw

 

 

6-2 Sound-controlled Maqueen Plus(only supports micro:bit V2.0) 

The following program calls the sound sensor on the micro:bit V2 motherboard. When you clap 
your hands, the car starts to drive and turns on the lights. When you clap your hands again, the 
car stops and turns off the lights. Repeat in this way. 

In the program, when the sound is detected to be greater than 100, the state of a Boolean value is 
reversed. Next, the program checks whether the Boolean value is true, if it is true, the car moves 
forward, if it is false, the car stops. 

Содержание MBT0021-EN

Страница 1: ...unctions and stronger performance Whether you have ever used Maqueen series products or not you ll find it very easy to get started 2 Specification Power Supply o MBT0021 EN 1 5V AA alkaline battery x...

Страница 2: ...3 Board Overview MBT0021 EN AA Battery Version MBT0021 EN 18650 18650 Version...

Страница 3: ...able batteries are safer than lithium batteries and are less prone to explosion and fire The voltage is 1 2V per cell The size of the Ni MH battery is the same as that of the AA alkaline battery There...

Страница 4: ...Step 2 Plug in the ultrasonic sensor Step 3 Insert the micro bit board Step 4 Connect the board to a PC via USB cable...

Страница 5: ...B cable and turn on the power switch After the above operations we downloaded an automatic obstacle avoidance robot program to the board Put Maqueen Plus on the ground it will automatically drive forw...

Страница 6: ...is used to indicate the intensity of light In the program we take a light intensity value of 100 as the demarcation point When the light intensity is greater than 100 the car is started otherwise the...

Страница 7: ...to avoid the obstacle and continue driving In the program the distance read by the ultrasonic is assigned to a variable and then it is judged that if the value of this variable is less than 30 the tu...

Страница 8: ...black line map the car will use the three line tracking sensor probes set at the bottom to detect whether the car is driving on the black line If it deviates from the black line the car will correct i...

Страница 9: ...ke it will be difficult to return to find the black line to continue driving In the following procedure we will use five probes and add another layer of detection on the left and right sides so that t...

Страница 10: ...tems of numeration hexadecimal and decimal In Maqueen PlusV2 we use decimal as the picture shows Example 1 In the following example we use the four buttons 2 4 6 and 8 of the infrared remote control t...

Страница 11: ...ill fall backward due to the reaction force We try to optimize the code and operating experience Program Link https makecode microbit org _TboWd2ihjD2k In this example we have made some changes to the...

Страница 12: ...e control handle and the two motherboards communicate through the wireless network to realize the remote control function Compared with infrared wireless communication has the characteristics of no di...

Страница 13: ...power of the handle and the car Move the joystick on the left side of the handle to control the forward backward left and right turn of the car However you may find a problem we can only control the d...

Страница 14: ...on the car side respectively Turn on the power of the handle and the car Gently push the joystick forward Maqueen Plus will gradually start and speed up Try turning around and going backward The speed...

Страница 15: ...ognized normally then you can try to calibrate it Methods as below 1 Place the car on the black block of the map which delivered with the product and make sure that the 5 sensors are in the black area...

Страница 16: ...er The picture shows the state of turning on the buzzer Flick to the other side to turn off the buzzer sound 9 Install HuskyLens Camera 1 Install the two copper pillars delivered by the product in the...

Страница 17: ...3 Install the other bracket the bracket and mounting screws are provided with the HuskyLens product 4 Install HuskyLens AI camera 5 Plug in the AI camera connection...

Страница 18: ...anic on the copper column with screws 3 Plug the connecting wire of the servo into any 5V port of P0 or P1 or P2 on the back and be careful not to plug it in the reverse direction FAQ For any question...

Отзывы: