Embedded Eye

Give your gizmo the gift of sight

ArduEye Aphid Initial Tutorial (Part 3): Exploring the ArduEye Examples

Introduction

On the ArduEye Wiki site there are three "Utility Sketches" that demonstrate different aspects of the ArduEye libraries. All three of these utility sketches will work with the ArduEye Aphid. The only requirement is that you first need to send the command "a1" (without quotes) via the Serial link to configure the Aphid to use the external ADC. (Alternatively, you can modify the code and find the line:

unsigned char adcType=SMH1_ADCTYPE_ONBOARD;

and change it to:

unsigned char adcType=SMH1_ADCTYPE_MCP3201;

Note that the "Stonyman Uno Rocket First Application" will not work with the Aphid, since that code was designed for the Rocket shield only.

Installing and Using the Processing GUI

Follow the instructions on the ArduEye Wiki site to install Processing. Note that you need to use Version 1.5.1 of Processing, not the new Version 2.0, and you need to install the ControlP5 library. Next install the GUI itself.

To get the GUI to talk to the ArduEye Aphid, you need to run the GUI, select the correct Serial/COM port from the drop down menu, and press "connect" (assuming the ArduEye is plugged in and programmed with an appropriate sketch). On some computers you may need to disconnect and reconnect to establish a connection. Then remember to send the command "a1" (without quotes) in the "Send" box to configure the Aphid to use the external ADC.

ArduEyeSMH Utility Example

This example allows you to explore the different features of the Stonyman image sensor. You may find it helpful to read the Stonyman data sheet and instructions to fully understand this section. Send the command "?" to get a list of all commands. The most important commands are:

a1 - This sets the Aphid to use the external ADC.

f - Grab a FPN pattern mask. Aim the Aphid at a blank texture, such as a white sheet of paper, when using this command. You should see the images clear up after you use this command.

M - MATLAB dump the entire chip: This acquires a complete image from the Stonyman and dumps it to the text area in MATLAB format. This function is better exploited using the standard Arduino serial terminal, since you can then copy and paste the text into MATLAB.

There are other functions as well that will make sense as you study the source code.

ArduEyeGUI Utility Example

This example shows how to send images, vectors, and pixels of interest (red squares) to the GUI.

ArduEyeOFO Utility Example

This example demonstrates how to compute 2D optical flow using a 10x10 array of pixels. Use the following commands in this order:

a1 - First send this command to select the external ADC.

f - Aim the Aphid at a blank texture and send "f". This will acquire a fixed pattern noise mask.

Now, if you move the sensor around you will see a green vector indicate the measured optical flow.

o# - With # being a number between 0 and 3, this selects one of four different methods of measuring optical flow. I tend to find the default method the best. (Note: This command doesn't appear when you use the "?" command, but it is still there.)

Questions

The above is an introduction. If you have questions (and I am sure there will be many), please post them below.

Views: 329

Reply to This

© 2017   Created by Geoffrey L. Barrows.   Powered by

Badges  |  Report an Issue  |  Terms of Service