Welcome to Tiny:bit Pro repository
2.3 QR code recognition
2.3 QR code recognition
2.3 QR code recognition1. Learning Objective2. Preparation for class 3. Programming Methods4. Blocks5. Code6. Download code7. Experimental phenomena
1. Learning Objective
In this course, we will realize k210 vision module recognize QR codes. When recognized, the Micro:bit board displays the contents of the QR code.
2. Preparation for class
- Remove the TF card from the k210 vision module and insert it into the card reader.
- Plug the card reader into the computer, and wait for the computer to recognize the USB disk.
- Then, enter the TF card U disk. You will see following content.
- Go to the k210 folder, find the 2.3_3.3_find_qrcodes.py file from the folder and copy it to the root directory.
Delete the original main.py file.
Then, re-name the 2.3_3.3_find_qrcodes.py file as the main.py file.
- After re-name, pull out the card reader, remove the TF card and insert it back into the k210 vision module.
3. Programming Methods
Online programming: first copy this URL https://makecode.microbit. and enter the online programming interface.
Copy the package URL: https://github.com/YahboomTechnology/K210-Module.git to the input field, click confirm to add the package, after that you can use the blocks of K210 vision module package.
4. Blocks
5. Code
6. Download code
Connect the Micro:bit board to the computer via Micro USB cable, the computer will pop up a U disk.
Then, select the microbit-qrcode.hex file and right click to send it to the Micro:bit U disk.
Wait until sending is complete and unplug the Micro:bit USB cable. Plug the Micro:bit board into the car.
7. Experimental phenomena
After starting the car, wait for the screen to display the camera image.
After the camera screen appears, point the camera at the QR code that needs to be recognized. When the QR code is recognized, the microbit board will display content of the QR code.
As shown below.
QR code image: