I'm entering into the robofest competition and I need some help. Basically I have to find the area of a black triangle taped onto a white table as quickly & accurately as possible. I'm going to use A=1/2B*a so I need my robot to find the base and the hight of the triangle.
I know I could use the motor rotations, but I was hoping for a quicker way to get the measurements I need. Could the Arduino use a camera or other sensors so my robot does not have to follow the edge of the triangle? Also money is not really an object, but I don't know to much programing for Arduino.
Arduinos aren't vert good with cameras. Not enough RAM to buffer the image.
If you put a bunch of optical sensors in a line you could sweep across the triangle in one movement. For each step where black is detected, add up the number of sensors between the left-most black sensed and the right-most black sensed. Continue until no black is sensed. The sum is proportional to the area of the triangle. The units of measurement are (spacing between sensors) wide and (step size) high.
Yes a light sensor and a light will allow you to detect the difference between white and black surfaces. If you tune them to detect Black and White you can use a digital input, of which the Mega has many.
What degree of accuracy do you need in the area measurement?
From the ATmega processor datasheet you can read the maximum voltage that will always read as LOW and the lowest voltage that will always read as HIGH. You want one color to read below the maximum LOW and the other color to read above the minimum HIGH.
"Line Follower" bots need to solve this same problem. Perhaps so research on those will turn up a proven digital design.
johnwasser:
Arduinos aren't vert good with cameras. Not enough RAM to buffer the image.
Why does everyone keep forgetting about the Nootropic Design Video Experimenter kit?
It's built on the back of a modified form of the TVOut library; that said, you likely won't have much code (or more likely, SRAM) room left over for the rest of your custom code (and you can't use a Mega with it) - but maybe you could devise a way to use one Arduino dedicated to the VE, and communicate with it via another Arduino (with your code on it).
Other options would be to build something like the AVRCam: