Step 3: Program the Roverbot
I’ve divided up each function into columns to make the flowchart easier to read. In the first column under “start” are the commands to test the Roverbot’s left forward motor. This will cause the Roverbot to turn right. Under the label “Test left backward” are the commands to turn the Roverbot’s left motor backwards. This will cause the Roverbot to turn left. The next four columns are the commands to test the right motor turning forward and backward, then turn both left and right motors forward (Roverbot rolls forward), and finally turns both motors backwards (Roverbot rolls backwards).
You can also convert the flowchart into BASIC program code. BASIC is an acronym that stands for Beginners All-purpose Symbolic Instruction Code. It was created way back in the 1960s as an easy to understand programming language to introduce students to computer programming.
Click Flowchart and then click Convert Flowchart to BASIC. The following is what the code will look like in BASIC (I added the comments in the code to describe what the code does):
‘BASIC converted from flowchart:
‘C:\DOCUMENTS AND SETTINGS\DESKTOP\SNAPROVERBOT.CAD
‘Converted on 10/30/2011 at 20:53:11
main:
‘Snap Rover programmable robot
‘
‘Test left forward
pause 1000
high 0
pause 2000
low 0
‘Test left backward
pause 1000
high 1
pause 2000
low 1
‘Test right forward
pause 1000
high 2
pause 2000
low 2
‘Test right backward
pause 1000
high 4
pause 2000
low 4
‘Test forward
pause 1000
high 0
high 2
pause 2000
low 0
low 2
‘Test backward
pause 1000
high 1
high 4
pause 2000
low 1
low 4
‘End program
stop
The code is very simple but should demonstrate how easy it is to program the Roverbot.
Remove these ads by
Signing Up






















Not Nice















Visit Our Store »
Go Pro Today »



