MyBot 120

RonnS

Member
oh yes i am old but i learned..to programm a picaxe

i bought a bot 120 kit... to spend creative hollidays...
the assembling was very simply..
the programming stressed my brain :)

i used the Logicator and the samples am mixed it together

*lol

her is the Part one after some ours and a good buddle of wine (a australian *lol )
Code:
Rem let dirsB = %11111111


main:
label_1:
if PinC.6 = 1 then Label_11
if PinC.6 = 0 then Label_1
high B.1
Low B.1
Pause 10
High B.3
Low B.3

Label_11:
for b4 =0 to 2
High B.3
High B.1
sound B.2,(50,10,50,50)
Pause 10
Low B.1
Low B.3
next b4

label_2:      Rem Drive the H-Bridge
		low 5
		high 4
		low 7
		high 6
		sound B.2,(50,10)
		input c.5	'motor speed fast
label_7:
		if pinC.3 = 1 then label_34	'Decision command
		if pinC.1 = 1 then label_29	'Decision command
		low 1
		low 3
		
		goto label_7

label_29:	high 1
		low 3
		low 4
		high 5
		low 6
		high 7
		sound 2,(82,100)
		pause 200	'Wait command
		low 5
		high 4
		low 6
		high 7
		pause 1000	'Wait command
		goto label_2

label_34:	low 1
		high 3
		low 4
		high 5
		low 6
		high 7
		sound 2,(82,100)
		pause 200	'Wait command
		low 4
		high 5
		low 7
		high 6
		pause 1000	'Wait command
		goto label_2


#no_table	'reduce download time
#no_data	'reduce download time
in the next i will integer the ultrasonic and the line follower

and others... i think i will write here.. the next steps
regards Ron
 

RonnS

Member
the next step is done today the Ultrasonic Range sensor SRF005 is fitted now at the front of the Bot
now MYBOT reacts on Range and Bump left and right.... the bumps com from lower floor or other thing were out of ultrasonic range

let dirsB = %11111111

setfreq m8

main:
label_1:
if PinC.6 = 1 then Label_11 Rem C.6 is the Push Button
if PinC.6 = 0 then Label_1 rem Return while not pushd
high B.1
Low B.1
Pause 10
High B.3
Low B.3

Label_11:
rem for b4 =0 to 2
High B.3
High B.1
sound B.2,(50,10,50,50)
Pause 10
Low B.1
Low B.3
rem next b4

label_2: Rem Drive the H-Bridge
input c.5 'motor speed fast
low 5
high 4
low 7
high 6
sound B.2,(50,10)

label_7:
if pinC.3 = 1 then label_34 'Decision command
if pinC.1 = 1 then label_29 'Decision command

pause 10
pulsout C.2, 2
pulsin C.2, 1, w0
w1 = w0 * 5 / 58 ; Convert to cm
if w1 > 5 then
forward A
forward B
else
goto label_29

end if
goto label_7

label_29: input C.5 ; slow seed while turn
high 1
low 3
low 4
high 5
low 6
high 7
sound 2,(82,100)
pause 200 'Wait command
low 5
high 4
low 6
high 7
pause 200 'Wait command

goto label_2

label_34: input C.5 ; slow speed while turn
low 1
high 3
low 4
high 5
low 6
high 7
sound 2,(82,100)

pause 200 'Wait command
low 4
high 5
low 7
high 6
pause 200 'Wait command

goto label_2


#no_table 'reduce download time
#no_data 'reduce download time
 
Top