60 likes | 142 Views
Final Project Questions. Web Design. What you asked me to teach…. What you asked me to teach…. Proximity Sensors. The fluke card is equiped with 3 sensors. getObstacle (<POSITION>) < POSITION> can either be one of 'left', ‘center’, or 'right‘
E N D
Final Project Questions Web Design
Proximity Sensors • The fluke card is equiped with 3 sensors. • getObstacle(<POSITION>) • <POSITION> can either be one of 'left', ‘center’, or 'right‘ • The values reported by these sensors range from 0 to 7000. A 0 implies there is nothing in front of the sensor where as a high number implies the presence of an object. • Example: • While (getObstacle(“middle”)==0):
What part of the picture is the object in… • You only care where the item is from side to side (not top to bottom). • “X” pixels are numbered from 0 to 255 / 0to 426 (left to right) • Divide the image into 3 parts: • Left third 0 – 84 /0 – 142 • Middle third 85 – 169 /143 – 284 • Right third 170 – 255 /285 - 426 • If you take the average of the X value of all the pixels that you think are in the cone you will know where the center of the cone is. • You will need to write code to nudge (barely turn) left or right to adjust to where the cone is in the picture.