掃碼模式

加入KOI 2庫

from future import *
from koi2 import KOI2

初始化KOI 2

koi = KOI2(tx, rx)

初次化KOI 2連接。

參數:

tx: TX 針腳,Robotbit EDU使用P2

rx: RX 針腳,Robotbit EDU使用P12

選擇掃碼模式

koi.setModel(256)

選擇掃碼模式

選擇掃碼類型

koi.scanCodeSwitchType(type)

選擇掃碼類型

參數:

type: 0 = QR Code, 1 = Barcode

獲取掃碼數據

獲取掃碼數據

參數:

data: 類型

data
代表

0

X coordinates

1

Y coordinates

2

Width of code

3

Height of code

獲取掃碼結果

返回掃碼結果

範例程式: 掃碼模式

Last updated