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 / 2001
2000  |  2002
Subject: 
Re: tweaking around dlcd_show( )
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 25 Aug 2001 10:28:40 GMT
Viewed: 
3951 times
  
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[PATTERN_ITEMS_NB][2]={
{LCD_4_BOTL} ,
{LCD_4_TOPL} ,
{LCD_4_TOP }
};

dlcd_show(progressPattern[ i ][0], progressPattern[ i ][1] );

Hope this helps.
Martin

In lugnet.robotics.rcx.legos, Alexandre Bec writes:
> 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 1 Reply:
  Re: tweaking around dlcd_show( )
 
Thanks Martin, I tried this too but it doesn't work : progress.c:27: macro `dlcd_show' used with too many (2) args progress.c:27: macro `BIT_OF' used with just one arg progress.c:27: macro `BYTE_OF' used with just one arg The hint seems to fit two (...) (25 years ago, 25-Aug-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  tweaking around dlcd_show( )
 
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); (...) (25 years ago, 25-Aug-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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

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