Question: What does the full flowchart look like for a code like this? ' { $STAMP BS 2 } ' { $PBASIC 2 . 5 }

What does the full flowchart look like for a code like this?
'{$STAMP BS2}
'{$PBASIC 2.5}
pulseCount VAR Byte
counter VAR Nib
old1 VAR Bit
old2 VAR Bit
counter =1
old1=0
old2=1
DO
FREQOUT 4,3000,3000
DO UNTIL IN13=1
HIGH 14
PAUSE 500
LOW 14
PAUSE 500
LOOP
DO
IF (IN2> IN1) THEN
IF (IN2> old2) AND (IN1> old1) THEN
counter = counter +1
IN2= old2
IN1= old1
IF (counter >4) THEN
counter =1
GOSUB Forward_Pulse
ENDIF
ENDIF
ENDIF
IF (IN2=0) AND (IN1=0) THEN
GOSUB Go_Straight
counter =1
ENDIF
IF (IN2=0) AND (IN1=1) THEN
GOSUB Turn_Right
ENDIF
IF (IN2=1) AND (IN1=0) THEN
GOSUB Turn_Left
ENDIF
IF (IN2=1) AND (IN1=1) THEN
GOSUB Forward_Pulse
ENDIF
IF (IN15=0) THEN
GOSUB Rotate_360
GOSUB Blink_LED
ENDIF
LOOP
LOOP
Forward_Pulse:
FOR counter =0 TO 1
PULSOUT 13,760
PULSOUT 12,740
PAUSE 20
NEXT
RETURN
Go_Straight:
PULSOUT 13,800
PULSOUT 12,700
PAUSE 20
RETURN
Turn_Right:
PULSOUT 13,800
PULSOUT 12,800
PAUSE 20
RETURN
Turn_Left:
PULSOUT 13,700
PULSOUT 12,700
PAUSE 20
RETURN
Rotate_360:
DO UNTIL IN2=1
PULSOUT 13,700
PULSOUT 12,700
LOOP
DO UNTIL IN2=0
PULSOUT 13,700
PULSOUT 12,700
LOOP
DO UNTIL IN2=1
PULSOUT 13,700
PULSOUT 12,700
LOOP
DO UNTIL IN2=0
PULSOUT 13,700
PULSOUT 12,700
LOOP
RETURN
Blink_LED:
FOR counter =1 TO 5
PAUSE 500
HIGH 14
PAUSE 500
LOW 14
NEXT
RETURN
What does the full flowchart look like for a code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!