SwingeyP
Member
Ok heres what I think then you can all say Oooh No - thats all wrong.
1:
look at serial line is there a code
NO? goback to 1
Yes? Ok what is the code?
Walk forward code?
Yes - lets walk forwards
Walk forward
Walk forward
walk forward
INTERUPT! - Excuse me!
Oh theres an interupt go to the interupt code
walk forward
walk forward
Interupt code:
Hey the ultrasonic sensor has detected something on the left
Turn right
turn right
turn right
blah blah
Ok now im stuck. What if the interupt comes with something on the right whilst its doing this ....
Hmmmm can anyone give me some psuedo code steps please? or just the basics. I understand that when an interupt is triggered it runs 'other' code - can keep registers etc in their states, and can return to where it left off etc...
Regards - Paul
1:
look at serial line is there a code
NO? goback to 1
Yes? Ok what is the code?
Walk forward code?
Yes - lets walk forwards
Walk forward
Walk forward
walk forward
INTERUPT! - Excuse me!
Oh theres an interupt go to the interupt code
walk forward
walk forward
Interupt code:
Hey the ultrasonic sensor has detected something on the left
Turn right
turn right
turn right
blah blah
Ok now im stuck. What if the interupt comes with something on the right whilst its doing this ....
Hmmmm can anyone give me some psuedo code steps please? or just the basics. I understand that when an interupt is triggered it runs 'other' code - can keep registers etc in their states, and can return to where it left off etc...
Regards - Paul