Subject:
|
Re: tweaking around dlcd_show( )
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Sat, 25 Aug 2001 18:33:32 GMT
|
Reply-To:
|
laleks@freeSPAMCAKE.fr
|
Viewed:
|
1656 times
|
| |
| |
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 arguments in one. But I don't know how to format
these in order for them to be accepted by dlcd_show AND by the two macros
I tried to use the "real" value 0xef46,0x4 instead of the define LCD_4_BOTL
dlcd_show(0xef46,0x4); and I got obviously the same error.
When trying at least to use directly the bit_set function with
bit_set (0xef46,0x4); it works,
but if I put these items in an array and invoking bit_set with
bit_set(progressPattern[ i ][0], progressPattern[ i ][1] );
I obtain a
"inconsistent operand constraints in an `asm' " because my array certainly
does not contain the right type of data for such a low-level operation. (how
can we fit a single bit in an array ?)
I'll probably use an other approach, based on arrays of pointers on simple
functions like :
int progress1{
dlcd_show(LCD_4_BOTL);
return 0;
}
maybe it will be easier...
Any help will be welcome
Alexandre.
On Saturday 25 August 2001 10:28, Martin Scragg wrote :
> 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
> > --
--
--
Alexandre BEC
laleks@free.fr
http://laleks.free.fr
--
|
|
Message has 1 Reply: | | Re: tweaking around dlcd_show( )
|
| (...) Ooops! I obviously wasn't looking at it properly last night (only browsing through the zip file). As 'dlcd_show' is defined as a macro that takes one parameter, but uses it twice to each of BIT_OF and BYTE_OF, which in turn both take 2 (...) (23 years ago, 26-Aug-01, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | 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)
|
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
|
|
|
|