HuskyLens 2 offers a very detailed tutorial on using MakeCode.(https://wiki.dfrobot.com/Tutorial%20for%20HUSKYLENS%202%20and%20micro:bit%20Graphical%20Programming(MakeCode))
- HuskyLens 2 Init I2C and select pattern.
huskylens2.I2CInit()
huskylens2.switchAlgorithm(huskylens2.Algorithm.AlgorithmFaceRecognition)
- HuskyLens 2 collects data for facial recognition and outputs it.
basic.forever(function () {
huskylens2.getResultFaceRecogtion()
if (huskylens2.availableFaceRecogtion()) {
serial.writeLine("id:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.Id))
serial.writeLine("NAME:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.Name))
serial.writeLine("X:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.XCenter))
serial.writeLine("Y:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.YCenter))
serial.writeLine("W:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.Width))
serial.writeLine("H:" + huskylens2.cachedCenterResult(huskylens2.BasePropertyId.Height))
serial.writeLine("----")
}
})
MIT
Copyright (c) 2020, microbit/micropython Chinese community
- for PXT/microbit