Luc Paquin
Published © CC BY

Project #30 - UNIHIKER - AI Motion - Mk12

Project #30 - UNIHIKER - AI Motion - Mk12

BeginnerFull instructions provided1 hour59
Project #30 - UNIHIKER - AI Motion - Mk12

Things used in this project

Hardware components

DFRobot UNIHIKER K10
×1
DFRobot Lithium Ion Battery - 1000mAh
×1
SparkFun Switch
×1
DFRobot USB 3.1 Cable A to C
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Fritzing

Code

DL2505Mk02p.mp

Arduino
/****** Don Luc Electronics © ******
Software Version Information
Project #30 - UNIHIKER - Ambient Light - Mk12
DL2505Mk02p.mp
DL2505Mk02
1 x UNIHIKER K10
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// Unihiker K10
#include "unihiker_k10.h"
// AT Recognition
#include "AIRecognition.h"

// Create an object
UNIHIKER_K10  k10;
// Screen
uint8_t screen_dir=2;
// AI Recognition
AIRecognition ai;

// Main program start
void setup() {
	
  // Begin
  k10.begin();
  // Init Screen
  k10.initScreen(screen_dir);
  // Init AI
  ai.initAi();
  // Init Camera Imager
  k10.initBgCamerImage();
  // Set Camera Imager
  k10.setBgCamerImage(false);
  // Canver
  k10.creatCanvas();
  // Switch AI Mode
  ai.switchAiMode(ai.NoMode);
  // Set Camera Image
  k10.setBgCamerImage(true);
  // Caver Text
  k10.canvas->canvasText("AI-Motion Detection", 1, 0x0000FF);
  // Switch AI Mode
  ai.switchAiMode(ai.Move);
  // Set Detection Threshold
  ai.setMotinoThreshold(30);
  // RGB
  k10.rgb->write(-1, 0x0000FF);

}
// Loop
void loop() {
	
  // Detect Content AI Recognition
  if (ai.isDetectContent(AIRecognition::Move)) {
		
    k10.rgb->write(-1, 0xFF0000);

  } else {
		
     k10.rgb->write(-1, 0x0000FF);

  }

}

Credits

Luc Paquin
44 projects • 4 followers
Teacher, Instructor, E-Mentor, R&D and Consulting -Programming Language -Microcontrollers -IoT -Robotics -Machine Learning -AI -Sensors

Comments