Boe Bot Navigates Through a Maze
by Mankaran76 in Circuits > Robots
522 Views, 1 Favorites, 0 Comments
Boe Bot Navigates Through a Maze
This instructable will help you create bumpers for the boe bot and it will provide you with the code that will navigate the boe bot through the maze.
Materials for the Bumpers.
Here is a list of materials you will need to make the bumpers:
-Cardboard
-Tape
-Wires
-Aluminium foil
-Resistors
-Velcro
Building the Bumpers Using the Materials.
What you will want to do first is using the cardboard make flaps and glue pieces of cardboard together to make a stack. Now, tape pieces of aluminium on the the flaps made from cardboard. There will be four pieces of aluminium foil that will be taped inside the flaps on each side. Now attach the flaps to the cardboard stack using glue. Next, attach the flat backside of the cardboard stack to the front of the boe bot using Velcro. Finally, attach the positive and negative wires to the aluminium foil on the flaps. Congratulations, you have now finished making the bumpers.
The Circuit.
The circuit is very simple and easy to make. Take a look at the picture and create the circuit on your Boe bot.
The Code.
Here is the code for the boe bot.
' {$STAMP BS2} ' {$PBASIC 2.5}
'I/O Pins 'Mankaran Kaler 'Mr.Birch 'Maze robot program 'Program to navigate the boebot through any maze
'----------varibles--------- LMotor PIN 14 RMotor PIN 15
loopX VAR Word
LFF CON 850 RFF CON 650 Lstop CON 750 Rstop CON 750 LRF CON 650 RRF CON 850
temp VAR Byte 'temporary store RunStatus DATA $00 'variable stored in ROM
'READ RunStatus, temp 'Read the variable from ROM
'temp = ~temp 'invert the value 0 to 1 or 1 to 0
'WRITE RunStatus, temp 'Write the variable back to ROM
'IF (temp>0) THEN END 'Check if the value is 1
' if so END the program right VAR Word
fast VAR Word
'----------actions---------------
DO
GOSUB ForwardFast
DEBUG ? IN10
IF IN10=0 THEN
HIGH 0
GOSUB LeftTurn
ELSE
LOW 0
ENDIF DEBUG ? IN11
IF IN11=0 THEN
HIGH 1
GOSUB RightTurn
ELSE
LOW 1
ENDIF
DEBUG CLS LOOP '-------------directions------------
LeftTurn: FOR right = 1 TO 120 PULSOUT LMotor, LRF PULSOUT RMotor, RFF NEXT RETURN
RightTurn: FOR loopX = 1 TO 120 PULSOUT LMotor, LFF PULSOUT RMotor, RRF NEXT RETURN
ForwardFast: FOR fast = 1 TO 300 PULSOUT LMotor, LFF PULSOUT RMotor, RFF NEXT RETURN