The microcontroller is Atmega 32U4 and developed using Arduino. Atmega 32u4 corresponds to Leonardo of Arduino
PCB drawing uses Lichuang EDA
SolidWorks.
Includes shell source files drawn using SolidWorks and STL files for 3D printing.
Includes the Arduino source code for the black eye and controller, excluding the NRF/OLED libraries used.
Includes PCB schematics and PCB diagrams of the black eye and controller.
The Arduino code is divided into two parts: Master & Slave, Master is the program of the control board, and Slave is the program of the black eye.
After the control board is started, the setup() section will be initialized.
1) Initialize the NRF module and start ACK mode.
2) Initialize Analog IO: A0 A1. Corresponds to the rocker potentiometer.
3) The initialization button is interrupted. (The button directly uses interrupts for input instead of scanning. Anyway, interrupts are enough XD)
4) Initialize the OLED and display the Black Eye icon for two seconds.
After the initialization is completed, the control board will continue to send data (command 7) through NRF in loop() and attempt to obtain ACK return packets.
If the data of the returned packet is correct, the connection is successful and the screen enters the working mode.
The ACK return packet includes the following information: servo speed, battery voltage, image transmission switch status, and servo switch status.
Regardless of whether the connection is successful or not, the control panel will still send control commands:
command 1/2/3/4: used to control the servo
command 5/6/8: used to control servo power/image transmission power/change servo speed
If there is no response after sending Command7 for more than 3 seconds, it is determined that the connection is disconnected.
Similar to Master, setup() performs NRF and IO initialization. A0 obtains the battery voltage, and control1/2 is used to switch the MOS tube that controls the image transmission and servo power supply.
In loop(), commands from Master will be continuously received and returned through ack after processing.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet