Dark_Samurai is right, you need to put the scan in a refresh loop. Something like this:

Code:
while(scanner_is_on)
{
c_scan(blah);
wait(5);
}


No need to have the scan done every cycle, saves processing power. This will update the you pointer accordingly.

cheers,