Microbit_ K210 barcode recognition

1.K210 and microbit communication

1.1 Experimental premises

This tutorial uses microbit V2.0, and K210 requires running the program in * * K210-AI (microbit) * * to start the experiment Microbit * 1 Eyu clip * 3 Several DuPont Lines K210 perspective module * 1 (requires SD card (with AI model inside) and camera) USB to TTL module * 1 Import k210AI library:https://github.com/YahboomTechnology/K210-Module

1.2 Experimental wiring

microbitUSB to TTL module
P1RXD
GNDGND
microbitk210
P2TXD
GNDGND

Wiring as shown in the diagram:

image-2023060800006 image-2023060800001

1.3 Main code analysis

image-2023060800009

From the code, simply configure the serial port and call the relevant serial port and K210 building blocks for data acquisition

 

1.4 experimental phenomena

  1. After connecting the cable, the K210 perspective module can be run offline K210 offline operation method
  2. Set the serial port assistant to the interface shown in the figure image-2023060800004
  3. Download the hex program of this tutorial into microbit
  4. After starting recognition, you can see that the serial assistant prints something and the microbit screen also scrolls to display the received information. The experimental results in the following figure show the phenomenon of barcode recognition image-2023060800002

This experiment displays the identified content of barcode recognition

1.5 Microbit calls the building blocks to parse the results of K210, and the roles of each block

Website of K210 library:https://github.com/YahboomTechnology/K210-Module image-2023060800005