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 / 2000
1999  |  2001
Subject: 
tweaking around dlcd_show( )
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 25 Aug 2001 01:05:44 GMT
Reply-To: 
LALEKS@FREE.FRantispam
Viewed: 
1509 times
  
Hi all legOS users,

need help  about dlcd_*   utilities

I'd like to display on the lcd a sequence of digits:
something like :

   dlcd_show (LCD_4_BOTL);
   lcd_refresh();
   msleep(250);
   lcd_clear();
   dlcd_show (LCD_4_TOPL);
   lcd_refresh();
   msleep(250);
   lcd_clear();
   dlcd_show (LCD_4_TOP);
...

But of course this is not a good idea to hardcode a long sequence.
So I tried to make a pattern of segments stored in an array, and access to
the good one with an index value in a for {   } loop.

int progressPattern[PATTERN_ITEMS_NB]={
{LCD_4_BOTL} ,
{LCD_4_TOPL} ,
{LCD_4_TOP }
};

and later
for (...){
...
lcd_clear();
dlcd_show(progressPattern[ i ] );
lcd_refresh();
msleep(250);
...
}

and I obtain the following compilation errors concerning dlcd_show( );

  macro `BIT_OF' used with just one arg
  macro `BYTE_OF' used with just one arg

I tried lots of braces combination , a declaration of a bidimensional array
too, but in vain.

Since I'm not an expert in C and macros, I certainly made something wrong
when filling this array with defines, and maybe it is not the right way to
proceed.

Thanks a lot for advance.

--
Alexandre BEC
laleks_at_free_dot_fr
--



Message has 2 Replies:
  Re: tweaking around dlcd_show( )
 
Hi, I haven't used LegOs (yet), but looking at the dlcd_show function, it expects 2 parameters. The defines are also for 2 parameters, so you would need to define and use it like this: int progressPattern[PATT...S_NB][2]={ {LCD_4_BOTL} , (...) (23 years ago, 25-Aug-01, to lugnet.robotics.rcx.legos)
  Re: tweaking around dlcd_show( )
 
(...) The macros LCD_?_* expand to two integers, separated by a comma; dlc_show() is a macro that expects one argument but uses it as an argument to macros expecting two arguments. I don't know exactly how this works, but it's to do with the order (...) (23 years ago, 3-Sep-01, to lugnet.robotics.rcx.legos)

10 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