Difference between revisions of "Getting Started with BPI-QCar"

From Banana Pi Wiki
Jump to: navigation, search
Line 124: Line 124:
The project file can be imported into Makecode to view and edit after downloading to local, or it can be directly burned to Micro:Bit through USB and run directly

Revision as of 02:03, 24 February 2021

About BPI-QCar

BPI Q-Car with micro:bit
BPI Q-Car with BPI-Bit
BPI-QCar with BPI-AI board

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

Key Features

  • 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

Motor control

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.

Q-Car Motor Test.gif

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/Motor_Demo

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.

Q-Car Pixel Test.gif

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/Pixel_Demo

Ultrasonic sensor control

Learning objective: master the use of Q-CAR ultrasonic sensor

Program effect display: serial port display ultrasonic measured distance data.

Q-Car Ultrasonic Test 1.gif

Q-Car Ultrasonic Test 2.png

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/Ultrasonic_Demo

How to use buzzer

Learning objective: master the use of BPI-QCAR buzzer

Program effect display: the buzzer play "little star music"

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/Buzzer_Demo

IR control

Objective: To master the infrared remote control of Q-CAR

Program effect display: infrared remote control Q-CAR forward and backward and turn

Q-Car IR Control.gif

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/IR_Control_Demo

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。

Q-Car Avoidance Demo.gif

Arduino code link:https://github.com/BPI-STEAM/Q-Car/tree/master/SoftWare/Web_Bit_Arduino/Avoidance_Demo


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

Microbit-screenshot (display graphics).png

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

Makecode(import file).png

The project file can be imported into Makecode to view and edit after downloading to local, or it can be directly burned to Micro:Bit through USB and run directly



在章节“使用MakeCode编程点亮Micro:Bit”的基础上,在MakeCode中“input”选项栏目中找到应用按钮控制的积木“on button A pressed”来进行编程


Using the button.png


The project file can be imported into Makecode to view and edit after downloading to local, or it can be directly burned to Micro:Bit through USB and run directly





Using the button 2.png


Routine project file:https://github.com/Wind-stormger/Makecode/blob/master/microbit-Using_the_button_2.hex





Q-Car velocity measurement module.png

Q-Car velocity measurement module Serial port.png

Routine project file:https://github.com/Wind-stormger/Makecode/blob/master/microbit-Q-Car_velocity_measurement_module.hex





Q-Car Motor control module.png

Routine project file:https://github.com/Wind-stormger/Makecode/blob/master/microbit-Q-Car_Motor_control_module.hex





Q-Car Pixel.png






Q-car Ultrasonic ranging.png



Routine project file:https://github.com/Wind-stormger/Makecode/blob/master/microbit-Q-car_Ultrasonic_ranging.hex





Q-car Music Arrangement.png

Routine project file:https://github.com/Wind-stormger/Makecode/blob/master/microbit-Q-car_Music_Arrangement.hex