| | 
      |   |   
            | Subject: 
 | Encoders 
 |  
            | Newsgroups: 
 | lugnet.robotics.handyboard 
 |  
            | Date: 
 | Thu, 20 May 1999 01:27:04 GMT 
 |  
            | Original-From: 
 | Joe Marie J. Maja <{maja@robotics.is.tohoku.}antispam{ac.jp}> 
 |  
            | Viewed: 
 | 1677 times 
 |  |  |  
 | 
 |  | Konnichiwa  !! 
 I am currently using the shaft encoder drivers of handy and it works
 fine, until I implemented a PID (Position Control).  I need to check the
 direction of my mobot.  Which means that - if it goes backward, I need
 to decrease the count and increase it if it goes forward.
 
 I tried to use 74HC74 to check the direction of the rotation of the
 encoder(My encoder have this sig A and sig B output).
 
 and run this code
 
 void check_right_encoder()  /*process*/
 {
 while(1)
 {
 if (encoder1_counts!=0)
 {
 if(digital(8)==0) {              /*check the direction
 of rotation */
 counter_r--;           /*declared as global
 */
 encoder1_counts=0;
 }
 else
 {
 counter--;
 encoder1_counts=0;
 }
 }
 }
 
 This works fine.
 
 QUESTIONS:
 
 Is there anyone who have tried to do the same thing, but implemented it
 in assembly - .icb?
 
 
 joema
 
 |  |  |  
 
 1 Message in This Thread:
 
  
 
      Entire Thread on One Page:
      
        Nested: 
        All | Brief | Compact | Dots
        Linear: 
        All | Brief | Compact
 | 
 | 
 | 
 |