Skip to content

peanut-king-solution/compoundEyeTester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compound Eye Serial Visualizer

Live PySide6/Qt debugger for Arduino serial data from a 12-eye IR sensor ring.

Expected Arduino line format:

eye0: 123 eye1: 456 eye2: 789 eye3: 100 eye4: 120 eye5: 140 eye6: 160 eye7: 180 eye8: 200 eye9: 220 eye10: 240 eye11: 260

Each eye is plotted on a full 360 degree circular chart with 30 degrees between neighboring sensors.

Geometry convention used by the program:

  • eye0 is on the right/east side of the graph at y=0.
  • Eye numbers increase anticlockwise.
  • eye3 is up, eye6 is left, and eye9 is down.

Setup

pip install -r requirements.txt

If you use the included .venv on Windows CMD:

.venv\Scripts\activate.bat
pip install -r requirements.txt

Find The Arduino Port

python serial_eye_plotter.py --list-ports

You can also launch the app without a port and choose the Arduino from the serial-port dropdown.

Common port names:

  • Windows: COM3, COM4, COM6, etc.
  • macOS: /dev/cu.usbmodem101, /dev/cu.usbserial-0001, /dev/tty.usbmodem101, etc.

Run

python serial_eye_plotter.py --baud 115200

Select the Arduino port from the dropdown and click Connect. Use Refresh after plugging or unplugging the board. The same dropdown works on Windows and macOS because it uses pyserial port discovery.

The left side of the window is the fast Qt circular plot. The right side is a serial monitor that shows the latest raw received lines and the parsed 12-eye values for debugging.

Useful options:

python serial_eye_plotter.py --port COM3 --baud 9600 --max-value 1023
python serial_eye_plotter.py --port /dev/cu.usbmodem101 --baud 115200 --max-value 1023
python serial_eye_plotter.py --port COM3 --print-values
python serial_eye_plotter.py --port COM3 --no-monitor
python serial_eye_plotter.py --port COM3 --min-interval 0.005

Performance tips:

  • Use --max-value 1023 for Arduino ADC values. A fixed scale avoids autoscale changes.
  • Use --no-monitor if you want maximum drawing speed and do not need the raw serial monitor.
  • Increase --min-interval, for example --min-interval 0.03, if your Arduino sends data much faster than the screen needs to refresh.

Test Without Arduino

python serial_eye_plotter.py --simulate

Arduino Output Example

The Python parser accepts : or = between the eye name and value. It also tolerates extra spaces.

Serial.print("eye0: "); Serial.print(eye0Value); Serial.print(" ");
Serial.print("eye1: "); Serial.print(eye1Value); Serial.print(" ");
// Continue through eye11...
Serial.print("eye11: "); Serial.println(eye11Value);

About

For testing the functionality of compound eye module

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages