Sharp GP2X sensors
.
for the first part to this libary focuses on GP2D120 and GP2D12 sensors, and will be expanded to include the whole range of sensors.
Noting that the data sheet for these has
1. a calibration curve, which is horrible,
2. a straight-ish line that involves the inverse of the distance, which is also horrible.
3. but only has 12 data points.
Making an assumption that each sensor is near enough to the datasheet to not matter for a normal hobby robot.
An array is used to return a minimum distance, comparing the normalised floating point number of the analog in to a threshold. A value of the closest the object can be is returned. test results show that this is remarkably accurate, and workable for a simple object avoidance algorthm. note, accuracy is based on datasheet and manual reading of the values contained in the graph, so not bad.
An optional array could be used to take user defined points. this would enable user calibration. this is next on the list to implement.
first stage is published.
<<program http:="" mbed.org="" users="" littlexc="" libraries="" GP2xx="" latest="" docs="" classIRRangeFinder.html="">>
very limited, if anyone wants to test it, feel free, and can you give me the results?
Please log in to post comments.