This project displays the color being detected by the Pmod COLOR on the screen. This was motivated by a need to be able to quickly determine whether the data being captured by the Pmod was useful or not.
Making your own version of this project is quite easy. Follow the tutorial for using a Pmod IP core, found here, to get the project set up in Vivado. At the point where you are told to copy and paste the main.c file into the application project you have created, use the main.c file provided here instead.
With a Python 3 installation, use the requirements.txt file provided to install the required pygame and pyserial python libraries. These two libraries will allow you to create a window to draw in, and communicate with your Zybo over a serial port, respectively.
Use the color_visualizer.py script provided to launch the color visualization window. THis script needs to be run from the command line and provided with the port that the Zybo is connected to, on Windows, this will be A COM# port, which one can be found using the Device Manager.
It is important to run the script only after the Vivado SDK project has been programmed onto the Zybo, as it will not wait to begin polling the serial connection.
Lastly, the project needs to be calibrated at run-time, point the color sensor at something lightly colored, then something dark.
Comments