PROGMEM.... store unsigned int ??

Hi all,
im working on some ir remote control code.

I have it working using "unsigned int" but im guessing il soon run out of SRAM so i wanted to store my "unsigned int" to PROGMEM instead.

Here's the original code:

#include <IRremote.h>

IRsend irsend;

unsigned int chDWN[100] 
= {
  4650,4450,550,450,600,400,600,400,600,450,550,1400,600,1400,600,450,550,450,600,400,600,1400,600,400,600,1400,600,1400,600,400,600,400,600,450,550,4450,600,400,600,450,550,450,600,400,600,400,600,1400,600,1400,600,400,600,450,550,450,600,1400,550,1450,550,1450,550,450,600,400,600,1400,600,1400,600,1400,550,450,600,400,600};

void setup()
{
  Serial.begin(9600);
}

void loop() {

  irsend.sendRaw(chDWN, 100, 12); // Channel down
  delay(2000);
  irsend.sendRaw(chDWN, 100, 12); // Channel down
  delay(2000);

}

But when i try to use PROGMEM i fail...

#include <avr/pgmspace.h>

#include <IRremote.h>

IRsend irsend;

PROGMEM  prog_uint16_t chUP[100] 
= {
  4650,4450,550,450,600,400,600,400,600,450,550,1400,600,1400,600,450,550,450,600,400,600,1400,600,400,600,1400,600,1400,600,400,600,400,600,450,550,4450,600,400,600,450,550,450,600,400,600,400,600,1400,600,1400,600,400,600,450,550,450,600,1400,550,1450,550,1450,550,450,600,400,600,1400,600,1400,600,1400,550,450,600,400,600};

void setup()
{
  Serial.begin(9600);
}

void loop() {
  
  unsigned int chupInt;
  int k;    // counter variable
 chupInt = pgm_read_word_near(chUP+ k);

  irsend.sendRaw(chupInt, 100, 12); // Channel down
  delay(2000);
  irsend.sendRaw(chupInt, 100, 12); // Channel down
  delay(2000);

}

Can anyone see what im doing wrong?

These are the errors i get..

IRsendDemo.cpp: In function 'void loop()':
IRsendDemo:21: error: invalid conversion from 'unsigned int' to 'unsigned int*'
IRsendDemo:21: error: initializing argument 1 of 'void IRsend::sendRaw(unsigned int*, int, int)'
IRsendDemo:23: error: invalid conversion from 'unsigned int' to 'unsigned int*'
IRsendDemo:23: error: initializing argument 1 of 'void IRsend::sendRaw(unsigned int*, int, int)'

Thanks!

unsigned int chupInt;
  int k;    // counter variable
 chupInt = pgm_read_word_near(chUP+ k);

A couple of things there; what's the value of "k"?

so i wanted to store my "unsigned int" to PROGMEM instead.

But it isn't an "unsigned int", it's an array of them, which is why the send fails.
You either have to rewrite the send function to use PROGMEM, or buffer the array in RAM.

oooooo i see now.

So how would i go about rewriting the send function? via editing the library?
or how would i go about buffering the array in RAM?

Which ever is easiest..

I got the "K" from the PROGMEM arduino page "PROGMEM - Arduino Reference"

I cant say i fully understand that myself.

This is what i think to be the send function in the Lib*

void IRsend::sendRaw(unsigned int buf[], int len, int hz)
{
  enableIROut(hz);
  for (int i = 0; i < len; i++) {
    if (i & 1) {
      space(buf[i]);
    } 
    else {
      mark(buf[i]);
    }
  }
  space(0); // Just to be sure
}

Thanks Again!