avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Const lookup table


From: Peter Bosscha
Subject: Re: [avr-gcc-list] Const lookup table
Date: Fri, 19 Apr 2002 14:11:24 +0200

Hi Andries,

There you go:

void ASSIGN_Relay(unsigned char Number)
{
 volatile unsigned char Relay_select = 0;
    static unsigned char PROGMEM Lookup_relay [16] = {
      0x06, 0x05, 0x07, 0x00, 0x02, 0x04, 0x01, 0x03,
      0x03, 0x01, 0x04, 0x02, 0x00, 0x07, 0x05, 0x06
      };
}

Of course you'll have to use PRG_RDB to get your variables (!)

Regards
Peter Bosscha


>>> Andries Posthumus <address@hidden> 04/19/02 12:15PM
>>>
Hi all
 
Please help, I would like to use a lookup table, in a subroutine. I
don't
want to store the lookup table in RAM, how can store it in program
memory
 
void ASSIGN_Relay(unsigned char Number)
{
 volatile unsigned char Relay_select = 0;
    static unsigned char Lookup_relay [16] = {
      0x06, 0x05, 0x07, 0x00, 0x02, 0x04, 0x01, 0x03,
      0x03, 0x01, 0x04, 0x02, 0x00, 0x07, 0x05, 0x06
      };
}

Andries Posthumus 


avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]