In this case I'm using a Python sript
Work's with two Esp 8266 and the ESP-NOW protocol
So there is an Esp Main that is conected to the computer via USB and it's job is to receive the serial data parse it and send to the ESP Child via the protocolWhen received the data is maped to the servos degres of operation and send it to the X and Y Servos
The eletronics is a laser diode controled by an transistor and a analog level converter because the laser and the servos works best with 5v while the eso is 3.3V even so it´s powered by 5V
- Esp 8266 NodeMCU
- 2 MG90S Tower Pro Micro Servo (Metal gears are importante for my heart)
- I2C Logic Converter Biderecional Module 5V<->3.3V
- 300 Ω resistor
- 0.1 micro Faraday more than 5v Resistor
- A Switch of your choice
- Laser Diode with internal resistor
Code | About |
---|---|
Master.cpp | Code uploaded to the masters ESP |
Chield.cpp | Code uploaded to the child |
Main.py | Main code with the integration : Begin Here |
SerialComMouse.py | If you want to control the laser with your mouse |
Indentificar.py | The function for face and the ball recognition |
FindHSVValues.PY | Code to adjust the HSV values for the ball recognition function otmization |
Here i'm using Platoform.io to upload to the microcontroler so this is because there is so much set up files.And you will need to install some things to make the esp and servo libs to work some quick google should work.In case you want to use the Arduino IDE just delet the #include <Arduino.h> and install the servo.h lib with the esp in the IDE
#include <ESP8266WiFi.h>
#include <espnow.h>
#include <Servo.h>
pip pip install opencv-python
pip install tkinter
#SetUp
In the python code you need to change the usb port in the SerialComunication.py
In the esp master change the int8_t broadcastAddress[]
variable to the Child mac adress to figure this out HERE
PS: This is my first try at writing documentacion so any problem feel free to contact me. :P