|
I'm guessing you want to know how to start. Well, granted, I am a rookie, but I have learned a lot.
1.Make a main subroutine and an autonomous subroutine
If auton_mode = 0 then Skip_Autonomous
Gosub AUTONOMOUS ' Jumps to subroutine for autonomous movement '
Goto NEXT_SCAN
Skip_Autonomous:
Gosub Normal_operation ' Jumps to subroutine for normal operation '
NEXT_SCAN:
Or something like that in between Serin and Serout
2. Write pseudocode for how you want the robot to behave
If sensor1 is lit, turn left
If sensor 2 is lit, go straight
if sensor 3 is lit, turn right
3. Be sure not to mess up any of your other code
__________________
"He said my name is Private Andrew Malone
If you're reading this then I didn't make it home
But for every dream that's shattered another one comes true
This car was once a dream of mine now it belongs to you
And though you may take her and make her your own
You'll always be riding with Private Malone" David Ball, "Private Malone"
|