Getting Started with BPI-QCar
- 1 About BPI-QCar
- 2 BPI-QCar with BPI:Bit for Arduino IDE
- 3 BPI-QCar with BPI:Bit use MicroPython
- 4 BPI-QCare with Micro:Bit use MakeCode
Banana PI BPI Q-Car,which is a robot focusing on maker education.Compatible with Web:Bit(BPI: Bit) and Micro:Bit development boards.Small car body, highly integrated functions, plug and play, can quickly children's attention, complete the quick start of graphics programming, cultivate independent thinking and logical thinking ability
- support Micro:bit, PBI:bit(Web:bit) and BPI-AI(WEB:AI) boards
- support Makecode graphical programming(with micro:bit)，support Webduino graphical programming（with BPI:bit）,and it also support MicroPython arduino（Micro:bit/BPI:bit）
- Compact body, strong integrity
- N20 Miniature reducer
- Infrared emission, infrared reception, line patrol, speed measurement, atmosphere lamp, I2C interface (support 3.3V and 5V), ultrasonic interface, buzzer, steering gear interface, needle row expansion port, expansion screw hole, etc...Fully functional, strong expansibility
- Easy to use it.
BPI-QCar with BPI:Bit for Arduino IDE
Arduino is an open source electronic prototyping platform that is flexible and easy to use.With the help of the community, BPI: BIT can be programmed with the Arduino environment, which you can refer to in the tutorial BPI:bit_for_Arduino
Learning Objectives: Master the basic motor control method of Q-CAR
Program effect display: car forward 1 second, stop 100ms, back 1 second, stop 100ms, left 1 second, stop 100ms, right turn 1 second, stop 100ms.
Ambient light control
Learning Objectives: To understand the basic usage of Q-CAR RGB atmosphere light
Program effect display: bottom RGB atmosphere light red, green, blue three color mixing gradient display a variety of colors, showing a color breathing effect.
Ultrasonic sensor control
Learning objective: master the use of Q-CAR ultrasonic sensor
Program effect display: serial port display ultrasonic measured distance data.
How to use buzzer
Learning objective: master the use of BPI-QCAR buzzer
Program effect display: the buzzer play "little star music"
Objective: To master the infrared remote control of Q-CAR
Program effect display: infrared remote control Q-CAR forward and backward and turn
Ultrasonic obstacle avoidance
Program effect display: boot the car forward, ultrasonic detection of the front distance, if the distance is less than 8cm, the car left and right to check the obstacles on both sides, choose the direction of the farther distance to turn, to avoid obstacles.
Parts preparation: M2 copper column ×2, M2 screw ×2, SR04 ultrasonic module ×1, ultrasonic bracket ×1, steering gear bracket ×1（Download address of bracket），DuPont line number, insert SR04 interface in front。
BPI-QCar with BPI:Bit use MicroPython
BPI-QCare with Micro:Bit use MakeCode
MakeCode programming light Micro:Bit Led
Learning Objectives: Familiarize yourself with basic Makecode applications and display some graphics or text on the Micro:Bit 5*5LED matrix.
Open the Makecode programming environment web side of Micro:Bit：https://makecode.microbit.org/
Create a new project and connect the Makecode blocks with the following routine. For example, the first block "Show Leds" can be found in the "Basic" options column. This block can edit the desired graphics
Right-click building blocks to carry out some operations on the building blocks, such as add notes, delete copy building blocks, as well as access to the corresponding documentation of the building blocks, this for the first time people can provide great help.
The MakeCode programming environment has an emulator with its own simulation of the program to view the effect in real time, usually displayed at the top left
The Makecode programming environment also supports importing project files from outside, such as.hex files that are compiled by Makecode
Routine project file：https://github.com/Wind-stormger/Makecode/blob/master/microbit-display-graphics.hex
Note：The correct way to import *.hex file is to download the.hex file from the link above and then import it into the MakeCode, rather than directly importing the link. External project links import the MakeCode differently
Micro:bit Button control - Base
Learning Objectives: Use the two buttons A/B on Micro:Bit to control the graphics to be output by the LED matrix
On the basis of the section "Using Makecode Programming to Light Micro:Bit", find the building block "On Button A Pressed" in the "Input" option column of Makecode to program
The routine is shown in the figure below. Press the A button to display the English character "A", press the B button to display the English character "B", and press the AB button to display A pattern shaped like A banana
Micro:bit Button control -advance
Learning objectives: Makecode programming to achieve a count and display button control procedures
Building on the previous section, create a new variable called "A_was_pressed_times" in the "Variables" section of the Makecode. This will generate multiple building blocks for the variable in the "Variables" section
Combine the addition blocks in the "Math" TAB and the Mosaic blocks in the "Variables" TAB. Refer to the following legend
At this point, we realized in the Makecode programming and made A use of the addition counting program, press A button A count to add 1 at the same time the counting value output to the LED matrix, press A button B count to return to 0 and clear the LED matrix display