To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3609
3608  |  3610
Subject: 
Motor Display
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 5 Jan 2004 21:51:06 GMT
Viewed: 
3573 times
  
For some silly reason, I was browsing through the BrickOS code and I noticed
this:

void motor_a_dir(MotorDirection dir)
{
  dm_a.dir = dm_a_pattern[dir];
  dlcd_hide(LCD_A_LEFT);
  dlcd_hide(LCD_A_RIGHT);
  if (dir == fwd || dir == brake)
    dlcd_show(LCD_A_RIGHT);
  else if (dir == rev || dir == brake)
    dlcd_show(LCD_A_LEFT);
}

Is that right, or has a problem already been found and corrected, here?

Problem: what if (dir==brake)?
I think only the right LCD arrow comes on.  There should be no "else".  The 2nd
to last line should start with 'if' not 'else if'

It's the same for all the motor functions

Steve



Message has 1 Reply:
  Re: Motor Display
 
(...) This problem has been fixed in the most recent CVS source file (dmotor.c), but as far as I can tell it hasn't been part of an offical release yet: (URL) (21 years ago, 5-Jan-04, to lugnet.robotics.rcx.legos)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR