How can I speed up the ADC?

dhenry:
I think your teacher laid out, too clearly in my view, what you needed to do.

.. Read the adc high byte, left aligned, provided you with 8-bit resolution. ..

That's what I ended up doing, as you can see in my code. The 8-bit resolution actually did the trick for me, it drastically reduces the processing time for normalizing the sensor values and translating those values into a line position.

dhenry:
Let me just add one more bit: you may want to think about your implementation. For you to implement a PID on top of a fast adc to just follow a line, either your car is powered by a rocket or your implementation is seriously wrong.

My car has to go 2 m/s, I really wanted some room to play in those 5 ms of cycle time. Now I've done some proper testing, apparently I've got plenty of room, even with a division factor of 128. Still, myAnalogRead is usefull, because I might want to go for fuzzy instead of PID. Once I comfortably get to those 2m/s, I might want to go even faster(but that's never going to happen in this universe :wink: )