Forum >Arduino (C) code to trigger "learning" button
Arduino (C) code to trigger "learning" button

Hello,
I need to be able to trigger the learning button with code. How is this done? Are you going to update the library or can you point me to figuring out how to trigger the learning button?
I need to be able to trigger the learning button with code. How is this done? Are you going to update the library or can you point me to figuring out how to trigger the learning button?
2020-10-29 23:34:53 Hello,
I need to be able to trigger the learning button with code. How is this done? Are you going to update the library or can you point me to figuring out how to trigger the learning button? You should be able to trigger a learn action by issuing a COMMAND_REQUEST_LEARN (0x36) command with the huskylens.writeLearn() call in Arduino. See Protocol.
See this arduino example:
adumont
I need to be able to trigger the learning button with code. How is this done? Are you going to update the library or can you point me to figuring out how to trigger the learning button? You should be able to trigger a learn action by issuing a COMMAND_REQUEST_LEARN (0x36) command with the huskylens.writeLearn() call in Arduino. See Protocol.
See this arduino example:
Code: Select all
Each time you'll ground the A0 pin in this example, the Huskylens will learn a new image for ID1. You can adapt the code to learn multiple classes (by using more pins for example). At the end, save the model to SD card to keep it for example. #include "HUSKYLENS.h" HUSKYLENS huskylens; void setup() { Serial.begin(115200); pinMode(A0,INPUT_PULLUP); Wire.begin(); while (!huskylens.begin(Wire)) { Serial.println(F("Begin failed!")); delay(100); } } void loop() { if(digitalRead(A0) == 0) { while (!huskylens.writeLearn(1)) // bool writeLearn(int ID) { Serial.println(F("learn object ID1 failed!")); delay(100); } Serial.println(F("learn object ID1 success")); } }
