line follower code

lord55

New Member
i have the line follower kit AXE121 it has a preprogrammed micro controller by assembly
i want to do my own program with basic using picaxe becouse my teacher wants to see the code while the microcontroller in the kit is 16 pins pic16f676 i want to use picaxe 18x instead. i'll try to fix this problem by soldering wires on the pic socket to connect them to picaxe 18x
but what code/instruction should be used for the infrared leds and the phototransistors.
is it infrain/infraout irin/irout instructions
or readadc for phototransistor
is there other ways to let infra red led to transmits signals other than infraout
btw, the assembly code is not provided
 

Rickharris

Senior Member
i have the line follower kit AXE121 it has a preprogrammed micro controller by assembly
i want to do my own program with basic using picaxe becouse my teacher wants to see the code while the microcontroller in the kit is 16 pins pic16f676 i want to use picaxe 18x instead. i'll try to fix this problem by soldering wires on the pic socket to connect them to picaxe 18x
but what code/instruction should be used for the infrared leds and the phototransistors.
is it infrain/infraout irin/irout instructions
or readadc for phototransistor
is there other ways to let infra red led to transmits signals other than infraout
btw, the assembly code is not provided
No one else is taking a shot at this so I will start:

Don't


Assuming you are in the UK and taking a UK exam:
Whilst your teacher may request the code in the line sensor it isn't necessary provided you state the line following module is a bought in part and describe what it does.

replacing it is going to give you all sorts of trouble.

IF you want to go that route build your own sensor from scratch - there is lots of information on the various robotic sites to help you with this.

One the other side if the line follower module used a 14 pin pic then replace it with a picaxe 14- after that you need to unpick what the module does from the information provided in the data sheet.
 

lord55

New Member
ok if im going to use a phototransistor and infrared led what commands would be the best for letting the ir leds transmiting and for the phototransistor reciveing and checking
 

medvampire

New Member
The rector had wow gold gone away for the day, being wow power leveling a man who disliked the sight of changes. He wow power leveling did not mean to return till the evening, when wow power leveling the new school-teacher would have arrived and settled in, and everything wow power leveling would be smooth again.
I think the forum has been spammed !
I hate to see spammers attack the here. I have found it a great learning tool to the axe.
I checked the post from this user and it looks a little like a forum bot so the mods here may want to ban this user and his ip addy.
Later
Steve
 

Dippy

Moderator
Yes, more spam from China. Over 90% of it is and I think we've only ever had 1 genuine member from China.

This one is via Cncgroup Beijing Province Network, Beijing.

But, I can't do anything apart from delete and it'll pop up again under a new name tomorrow. So please don't PM/email me every time there is a spamattack. My Inbox is filling up quicker than a footballer's bank account.
 

lord55

New Member
well i did this code but it doesnt seem to be working well

infrared:
high 0 'switch on infrared led 1
high 1 'switch on infrared led 2
high 2 'switch on infrared led 3

main:

readadc 0, b0 'read phototransistor 1 signal
readadc 1, b1 'read phototransistor 2 signal
readadc 2, b2 'read phototransistor 3 signal

if b0>b1 and b0 > b2 then gosub left
if b1 > b0 and b1 > b2 then gosub right
if b2> b0 and b2> b1 then gosub center
goto main


left:
low 5 'turn off output 5
low 6 'turn off output 6
high 7 'turn on output 7
goto main
right:
high 6 'turn on output 6
low 7' turn off output 7
low 5' turn off output 5
goto main
center:
high 5 'turn on output 5
low 7 'turn off output 7
low 6 'turn off output 6
goto main
 

Rickharris

Senior Member
In what way does this not work?

I know we keep repeating this but crystal balls we don't have you need to tell us what is happening.

Please note the comments in another post about helping isn't the same as doing it for you so your not likely to get out and out answers to you questions your going to have to work some out for yourself.

What do you have in your code that is working - are the LEDs sensed?
can they tell the difference between white and black.
can you controller move the motors in the relevent directions without any line sensing input i.e. is the motor control working.

your programme breaks down into a number of smaller areas try to see what they are and find out if each one is working then try to get them working together.
 
Top