It is currently Wed May 22, 2013 11:00 pm
       


All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: LineData
PostPosted: Wed Aug 20, 2008 3:32 pm 
Offline
arexx.com user

Joined: Wed May 28, 2008 3:17 pm
Posts: 31
Location: Montréal
Hi guys,
what do you think about it:

Quote:
#include "asuro.h"
int main(void)
{
unsigned int lineData[2];
Init();
FrontLED(ON);
StatusLED(GREEN);
MotorDir(FWD,FWD);
while (1){
LineData(lineData);
if (lineData[0]<lineData[1]) {
MotorSpeed (40,120);
}
else if (lineData[0]>lineData[1]) {
MotorSpeed (120,40);
}
else if (lineData[0]==lineData[1]) {
MotorSpeed (100,100);
}
}
return 0;
}


It works! You can imagine that i was really happy to see my asuro follows its way perfectly...
I wonder if the last condition is necessary: i mean this one: ==

Gualdim


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 23, 2008 1:52 am 
Offline
arexx.com user

Joined: Wed May 28, 2008 3:17 pm
Posts: 31
Location: Montréal
So what do you think about the last instruction?
Some of you would tell me: just try! But i want your opinion...!! ;-)

Gualdim


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 5:31 am 
Offline
New User

Joined: Sat Nov 08, 2008 7:43 am
Posts: 1
yes ,I approve your view .
But my asuro does not walk according to the path .
Below is my code :
int main()
{
unsigned int data[2];
Init();
MotorDir(FWD,FWD);
while(1)
{
LineData(data);
if(data[0]>data[1])
{
MotorSpeed(200,150);
}
else if(data[0]<data[1])
{
MotorSpeed(200,150);
}
else
{
MotorSpeed(200,200);
}
}
return 0;
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 11:28 pm 
Offline
VIP - AREXX STAFF
User avatar

Joined: Thu Jun 23, 2005 10:52 am
Posts: 693
Location: Zwolle
Hello,

@Gualdim

this last instruction:

else if (lineData[0]==lineData[1]) {
MotorSpeed (100,100);

Will not do many, as lineData[x] will be different with each reading say between 50 and 200 and chances that both are equal in one reading is very unlikely. So theoretically I think it won't add much to the linefollower function.

@hemoparrot
maybe the speed changes are not extreem enough. Just experiment with different values.

Regards,

Henk


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group