Monday, 22 March 2010

Programming

The following is how i want my programming of the LFR to pan out. The 1's are when my sensor has sensed the line and my O's for when it hasn't. In effect with 5 sensors there are only 32 combinations (binary) that need to be accounted for in my program.

00000- No line stand still.
00001- Hard right
00010-Gentle right
00011-Gentle right
00100-On track keep forward
00101- Error keep on current trajectory
00110-Keep on trajectory
00111-Hard right (corner)
01000-Gentle left
01001-Error
01010-error
01011-error
01100-keep on trajectory
01101-error
01110-hard left (corner)
01111-hard left (corner)
10000-hard left
10001-error
10010-error
10011-error
10100-error
10101-error
10110-error
10111-error
11000-Gentle left
11001-error
11010-error
11011-error
11100-Hard Left.
11101-error
11110-hard left
11111-Stop

I now need to decide weather it is best to use interrupts or not. They would be faster , however, and would allow code to continue uniterrupted untill a corner or deviation from the line would be detected. However my lack of knowledge on programming interrupts in PICAXE Basic will need to be enlarged as it has not been covered in great detail.

No comments:

Post a Comment