Revision 1901
Updated main to work for the demo. It now switches states properly, but button1 seems to trigger accidentally sometimes (but strangely consistently at the same point in the program). Also edited the random turn generator to use the rtc instead of a rangefinder for the seed.
validTurns.c | ||
---|---|---|
11 | 11 |
|
12 | 12 |
/******************************Random Num Gen Version of validTurns*/ |
13 | 13 |
int randomNumGen(int max){ |
14 |
int x = range_read_distance(IR2);
|
|
14 |
int x = rtc_get();
|
|
15 | 15 |
if (x>0) return range_read_distance(IR2)%max; |
16 | 16 |
else return randomNumGen(max); |
17 | 17 |
} |
Also available in: Unified diff