It is currently Mon May 20, 2013 4:45 am
       


All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Get MotorSpeed
PostPosted: Wed Jan 18, 2006 10:40 pm 
Offline
arexx.com user

Joined: Fri Jan 06, 2006 3:42 pm
Posts: 7
I understand it's possible to set the MotorSpeed and MotorDir but is it possible to get these values ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 20, 2006 5:21 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Not directly - you could read the registers of course - have a look at the source code of asuro.c:

Code:
/* Set motor speed */
inline void MotorSpeed(unsigned char left_speed, unsigned char right_speed)
{
   OCR1A = left_speed;
   OCR1B = right_speed;
}

/* Set motor direction */
inline void MotorDir(unsigned char left_dir, unsigned char right_dir)
{
   PORTD = (PORTD &~ ((1 << PD4) | (1 << PD5))) | left_dir;
   PORTB = (PORTB &~ ((1 << PB4) | (1 << PB5))) | right_dir;
}


So you could read OCR1A register to get speed value of left motor.

You can also edit the asuro.c file and add variables that store these values...


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 10:20 am 
thanks for the reply, I will give that a try.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group