TensorFlow Lite - Magic Wand
材料準備
• AmebaD [ AMB23 / AMB21 / AMB22 / BW16 / AW-CU488 Thing Plus / AMB25 ] x 1
• Adafruit LSM9DS1 加速感測器
• LED x 2
範例
流程
AMB21 / AMB22 接線圖:
如下圖,將加速感測器和LED連接到開發板上。
AMB23 接線圖:
直接使用 AMB23 板上的LED
BW16 接線圖:
直接使用 BW16 板上的LED
BW16 type C 接線圖:
AW-CU488 Thing Plus 接線圖:
AMB25 接線圖:
從以下網址下載TensorFlow Lite for Microcontrollers的Ameba版本 https://github.com/ambiot/ambd_arduino/tree/master/Arduino_zip_libraries。
請按照以下說明進行安裝操作 https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries。
確保在以下位置找到patch文件並安裝 https://github.com/ambiot/ambd_arduino/tree/master/Ameba_misc/。
打開範例, “Files” -> “Examples” -> “TensorFlowLite_Ameba” -> “magic_wand”.
上傳代碼並在上傳完成後按Ameba上的重置按鈕。
保持加速感測器穩定,使x軸的正極指向右側,z軸的正極指向上方,按照所示形狀移動加速感測器,使其平穩運動1至2秒鐘,避免劇烈運動。
如果Tensorflow Lite模型可以識別移動,則應該看到相同形狀的輸出到Arduino串行監視器。對應於不同的識別手勢,不同的LED將亮起。
請注意,機翼形狀易於實現,而坡度和環形形狀則更難於正確定位。
程式碼說明
有關TensorFlow Lite for Microcontrollers的更多信息,請參考以下網址: https://www.tensorflow.org/lite/microcontrollers