You’ve taught the Pixy2 which color signatures to recognize, and assigned each color to a number. In this tutorial, we will load the Pixy2TerminalDisplay.svg BlocklyProp code into the Propeller Activity Board and see each object's position and size using the Terminal. The BlocklyProp program will receive and parse that data from the Pixy2, and then decide what to do with it.
- Disconnect USB cable from the Pixy2.
- Connect the Activity Board’s 5V supply to the Pixy2 as shown in Power Supply Setup (B).
- If you use the 5V supply from the black row of pins on top of the breadboard, put the Propeller Activity Board's swich in Position 1 or 2.
- If you use the 5V supply on the servo headers, put the Propeller Activity Board's switch in Position 2.
- Download Pixy2TerminalDisplay.svg
- Start BlocklyProp Launcher and solo.blocklyprop.com.
- Click the Open Project / Choose File and open the Pixy2TerminalDisplay.svg you just downloaded.
This program has many functions to manage the serial data parsing from the Pixy2. These functions are shown in “collapsed” view (right-click a function if you want to expand it). You will not need to use most of these function blocks; it is convenient to keep their view collapsed.
- Click the Load and run (Save code to EEPROM) button.
After loading code into the Propeller Activity Board, BlocklyProp Solo will open its Terminal and display information about colored objects that you have trained the Pixy2 to detect.
- Try placing some of those colored objects in the Pixy2’s view, and verify that its signature number, position and size are displayed.
Congratulations! Your BlocklyProp program is now ready to be modified and used on the ActivityBot 360 to track objects!
If you find BlocklyProp’s Terminal too slow to refresh, you can use Parallax Serial Terminal (PST) instead, which only runs on Windows operating systems. PST’s display may be paused or cleared and also supports multiple font sizes. To use PST:
- Download and unzip Parallax Serial Terminal.
- Double click Parallax-Serial-Terminal.exe to run it. (No installation required.)
- Press Close on the BlocklyProp Terminal.
- Set Baud Rate to 115200.
- Click Enable.
- Press/release the Propeller Activity Board’s RST button.
- Click into the light yellow transmit pane, and press any key.
A Tiny Tutorial video on using PST instead of BlocklyProp Terminal is also available.