- HuskyLens Init I2C and select pattern.
huskylens.initI2c()
huskylens.initMode(protocolAlgorithm.ALGORITHM_FACE_RECOGNITION)
- HuskyLens requests the data and stores the requested data in the result for later use.
basic.forever(function () {
huskylens.request()
})
- HuskyLens retrieves the desired result from the result (For example, get the X center of the ID1 box).
huskylens.initI2c()
huskylens.initMode(protocolAlgorithm.ALGORITHM_FACE_RECOGNITION)
basic.forever(function () {
huskylens.request()
if (huskylens.isLearned(1)) {
if (huskylens.isAppear(1, HUSKYLENSResultType_t.HUSKYLENSResultBlock)) {
serial.writeValue("box", huskylens.readeBox(1, Content1.xCenter))
}
}
})
- HuskyLens retrieves the parameters of the center box on the screen from the result.
huskylens.initI2c()
huskylens.initMode(protocolAlgorithm.ALGORITHM_FACE_RECOGNITION)
basic.forever(function () {
huskylens.request()
serial.writeValue("box", huskylens.readBox_s(Content3.ID))
})
- HuskyLens gets the parameters of the Nth box from the result.
huskylens.initI2c()
huskylens.initMode(protocolAlgorithm.ALGORITHM_FACE_RECOGNITION)
basic.forever(function () {
huskylens.request()
serial.writeValue("box", huskylens.readBox_ss(1, Content3.ID))
})
MIT
Copyright (c) 2020, microbit/micropython Chinese community
- for PXT/microbit