Yes.First, does the above make sense?
I do not have any code but here is how I might try setting it up.Second, do any of you know some PBP code that does a similar comparison?
First add a switch on the car and code for the switch at power-up. Also add a LED for calibration indicator.
If switch is HIGH then ADC_SETUP routine. The code will go here once and never loop back to it.
Inside the SET_UP routine have the drive wheels turned off and sub loop reading the ADC from the light and the "calibration" pot.
Have it coded so when the reading from the light and pot are equal with in a certain amount (exact will be difficult) the calibration LED come on.
Then when the calibration switch is turned off the code will go to EXIT_SETUP. This routine will save the ADC reading from the pot to EEPROM then goto the main program.
Now the main program will read the EEPROM to get the value to use for light checking. The reason for EEPROM writing is you will only have to "setup" once and not have to do the setup every time the car is turned on. Maze changes do another SET_UP.
Turn to the students and say "SSHHH"Three, I believe I will need to smooth out noise during the transition as the car comes into and leaves the bright light? How would you suggest I do that?
Are you meaning light noise? If so this is where the ADC needs to be with in a certain amount so a small range of "bright" light will do the triggering. This partwill take some experimentation for car speed and othe on site variables.
Bookmarks