Outdated code on instructable?

So I'm building an instructable that was made almost a decade ago so I think there's some outdated code that I copy-pasted from this guys GitHub. I'd like to know what's causing my code to not compile.

Here's the GitHub

I've downloaded the library specified but it's still giving me errors. Here's the complete error log.

Arduino: 1.8.2 (Windows 10), TD: 1.36, Board: "Teensy 2.0, Serial, 16 MHz, US English"

LeoneLabs_Laser_Ball_source_v1_31:47: error: 'prog_uint16_t' does not name a type
extern prog_uint16_t laser_frames1[];

^

LeoneLabs_Laser_Ball_source_v1_31:48: error: 'prog_uint16_t' does not name a type
extern prog_uint16_t laser_frames2[];

^

LeoneLabs_Laser_Ball_source_v1_31:49: error: 'prog_uint16_t' does not name a type
extern prog_uint16_t laser_frames3[];

^

LeoneLabs_Laser_Ball_source_v1_31:50: error: 'prog_uint16_t' does not name a type
extern prog_uint16_t laser_frames4[];

^

LeoneLabs_Laser_Ball_source_v1_31:51: error: 'prog_uint16_t' does not name a type
extern prog_uint16_t* seq_select[];

^

LeoneLabs_Laser_Ball_source_v1_31:55: error: 'prog_uint16_t' does not name a type
prog_uint16_t laser_pixels[1000]; //pixel buffer, gets animated in the main loop

^

LeoneLabs_Laser_Ball_source_v1_31:98: error: variable or field 'load_sequence' declared void
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

LeoneLabs_Laser_Ball_source_v1_31:98: error: 'prog_uint16_t' was not declared in this scope
LeoneLabs_Laser_Ball_source_v1_31:98: error: 'prog_uint16_t' was not declared in this scope
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

LeoneLabs_Laser_Ball_source_v1_31:98: error: expected primary-expression before 'int'
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

LeoneLabs_Laser_Ball_source_v1_31: In function 'void loop()':
LeoneLabs_Laser_Ball_source_v1_31:82: warning: comparison between signed and unsigned integer expressions
for (int j=0;j<loop_length;j++){ //loop length is in units of "cycles"

^

LeoneLabs_Laser_Ball_source_v1_31:85: error: 'seq_select' was not declared in this scope
load_sequence(seq_select[pat_select],laser_pixels,seq_lengths[pat_select]/sizeof(int)); //loads each "frame" ("laser_frames[]") into pixel buffer ("laser_pixels[]")

^

LeoneLabs_Laser_Ball_source_v1_31:85: error: 'laser_pixels' was not declared in this scope
load_sequence(seq_select[pat_select],laser_pixels,seq_lengths[pat_select]/sizeof(int)); //loads each "frame" ("laser_frames[]") into pixel buffer ("laser_pixels[]")

^

LeoneLabs_Laser_Ball_source_v1_31:85: error: 'load_sequence' was not declared in this scope
load_sequence(seq_select[pat_select],laser_pixels,seq_lengths[pat_select]/sizeof(int)); //loads each "frame" ("laser_frames[]") into pixel buffer ("laser_pixels[]")

^

F:\Users\mlsoccer2\Documents\DIY\Laser Ball\LeoneLabs_LaserBall-master\LeoneLabs_Laser_Ball_source_v1_31\LeoneLabs_Laser_Ball_source_v1_31.ino: At global scope:

LeoneLabs_Laser_Ball_source_v1_31:98: error: variable or field 'load_sequence' declared void
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

LeoneLabs_Laser_Ball_source_v1_31:98: error: 'prog_uint16_t' was not declared in this scope
LeoneLabs_Laser_Ball_source_v1_31:98: error: 'prog_uint16_t' was not declared in this scope
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

LeoneLabs_Laser_Ball_source_v1_31:98: error: expected primary-expression before 'int'
void load_sequence(prog_uint16_t source[], prog_uint16_t destination[], int pixel_count){

^

'prog_uint16_t' does not name a type
A library named Arduino-IRremote-master already exists

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I don't know what the problem is. To help others who may know more this seems to be the main program code

/*
How to use/create new animation pattern presets:
-   "laser_frames[]" represents which lasers are ON in each frame. 
-   While laser_frames[] is a 1D array of values, I've chosen a syntax that shows the values divided into "rows".
-   Each "row" represents a 1D array of lasers as one "frame". 
-   So sequential "rows" represent sequential frames in time.
-   Each "row" should have "n_laser" values, so if n_lasers=14, then to for easily readability, each row should have 14 columns.
*/
PROGMEM prog_uint16_t laser_frames1[] = //to store in flash memory "PROGMEM prog_uint16_t" datatype is necessary
                       {
                     // 1,2,3,4,5,6,7,8,9,10,11,12,13,14 //this is my laser mapping on the ball  
                        1,0,1,0,1,0,0,0,1, 0, 0, 1, 0, 1,
                        0,1,0,1,0,1,1,1,0, 1, 1, 0, 1, 0,
                       };
PROGMEM prog_uint16_t laser_frames2[] =
                       {
                       1,0,0,0,0,0,0,0,0,0,0,0,0,1,
                       0,1,0,0,0,0,0,0,0,0,0,0,1,0,
                       0,0,1,0,0,0,0,0,0,0,0,1,0,0,
                       0,0,0,1,0,0,0,0,0,0,1,0,0,0,
                       0,0,0,0,1,0,0,0,0,1,0,0,0,0,
                       0,0,0,0,0,1,0,0,1,0,0,0,0,0
                       };
PROGMEM prog_uint16_t  laser_frames3[] =
                       {
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,1,1,1,1,0,0,0,0,0,
                       0,0,0,0,1,1,1,1,1,1,0,0,0,0,
                       0,0,0,1,1,1,1,1,1,1,1,0,0,0,
                       0,0,1,1,1,1,1,1,1,1,1,1,0,0,
                       0,1,1,1,1,1,1,1,1,1,1,1,1,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       0,1,1,1,1,1,1,1,1,1,1,1,1,0,
                       0,0,1,1,1,1,1,1,1,1,1,1,0,0,
                       0,0,0,1,1,1,1,1,1,1,1,0,0,0,
                       0,0,0,0,1,1,1,1,1,1,0,0,0,0,
                       0,0,0,0,0,1,1,1,1,0,0,0,0,0,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       };
PROGMEM prog_uint16_t laser_frames4[]  =
                       {
                       1,0,0,0,0,0,1,1,0,0,0,0,0,1,
                       0,1,0,0,0,1,0,0,1,0,0,0,1,0,
                       0,0,1,0,1,0,0,0,0,1,0,1,0,0,
                       0,0,0,1,1,1,1,1,1,1,1,0,0,0,
                       0,0,1,1,1,1,1,1,1,1,1,1,0,0,
                       0,1,1,1,1,1,1,1,1,1,1,1,1,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       0,1,1,1,1,1,1,1,1,1,1,1,1,0,
                       0,0,1,1,1,1,1,1,1,1,1,1,0,0,
                       0,0,0,1,1,1,1,1,1,1,1,0,0,0,
                       0,0,0,0,1,1,1,1,1,1,0,0,0,0,
                       0,0,0,0,0,1,1,1,1,0,0,0,0,0,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       };
PROGMEM prog_uint16_t laser_frames5[] =
                       {
                       1,0,1,0,1,0,1,0,1,0,1,0,1,0,
                       0,1,0,1,0,1,0,1,0,1,0,1,0,1,
                       };
PROGMEM prog_uint16_t laser_frames6[] =
                       {
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       0,0,0,0,0,0,1,1,0,0,0,0,0,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       1,1,0,0,0,0,1,1,0,0,0,0,1,1,
                       1,1,0,0,0,0,1,1,0,0,0,0,1,1,
                       1,1,0,0,0,0,1,1,0,0,0,0,1,1,
                       1,1,0,0,0,0,1,1,0,0,0,0,1,1,
                       1,1,0,0,0,0,1,1,0,0,0,0,1,1,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,1,1,
                       1,1,0,0,0,0,0,0,0,0,0,0,1,1,
                       1,1,1,1,1,1,1,1,1,1,1,1,1,1,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       };                       
//used to select which pattern to display                       
prog_uint16_t* seq_select[] = {
                    laser_frames1,
                    laser_frames2,
                    laser_frames3,
                    laser_frames4,
                    laser_frames5,
                    laser_frames6
                    };
//stores the length of each pattern in order to loop properly
int seq_lengths[] = { //need this because sizeof() is a compile-time function, not run-time. So I can't use laser_frames[] as a variable in the main loop, meaning sizeof(laser_frames[]) must be called up front.
                    sizeof(laser_frames1),
                    sizeof(laser_frames2),
                    sizeof(laser_frames3),
                    sizeof(laser_frames4),
                    sizeof(laser_frames5),
                    sizeof(laser_frames6)
                    };

int seq_count = sizeof(seq_lengths)/sizeof(int);

There are also two other .ino files. I don't think their absence is the cause of the problem because I tried incorporating the code with all the progmem data. I will leave it as homework for the OP to post the code from the other files.

I was trying to compile it with IDE 1.6.3 and I got similar error messages. But the errors don't seem to make sense for the line numbers referred to.

...R

The types starting with 'prog_' have been removed. Take off the 'prog_' and add 'const' before the type and add 'PROGMEM' if it isn't already there. For example:

PROGMEM prog_uint16_t laser_frames2[] =

becomes

const uint16_t  PROGMEM laser_frames2[] =

Hey thanks. Does PROGMEM always go after const uint16_t? Or really whenever it appears? Also I think I finished what you said and at least the error code is a lot smaller now!

ERROR MESSAGE LOG:

Arduino: 1.8.2 (Windows 10), TD: 1.36, Board: "Teensy 2.0, Serial, 16 MHz, US English"

LeoneLabs_Laser_Ball_source_v1_31: In function 'void loop()':
LeoneLabs_Laser_Ball_source_v1_31:82: warning: comparison between signed and unsigned integer expressions
for (int j=0;j<loop_length;j++){ //loop length is in units of "cycles"

^

LeoneLabs_Laser_Ball_source_v1_31: In function 'void load_sequence(const uint16_t*, const uint16_t*, int)':
LeoneLabs_Laser_Ball_source_v1_31:100: error: assignment of read-only location '(destination + ((sizetype)(((unsigned int)i) * 2u)))'
destination=pgm_read_word_near(&source);
_
^_
_assignment of read-only location '(destination + ((sizetype)(((unsigned int)i) * 2u)))'_

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
MAIN CODE:
```
*//Laser Ball source code v1.3
//LeoneLabs 2011
//mleone@leonelabs.com
//www.leonelabs.com

//Overview:
//The code will animate the lasers in the Laser Ball and interpret IR signals from a
//remote control to change patterns and their animation speed.

//Tutorials:
//Interrupts - http://www.arduino.cc/en/Reference/AttachInterrupt
//IR remote - A Multi-Protocol Infrared Remote Library for the Arduino

//Hardware:
//Mini remote control - Mini Remote Control : ID 389 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits
//IR sensor - IR (Infrared) Receiver Sensor [TSOP38238] : ID 157 : $1.95 : Adafruit Industries, Unique & fun DIY electronics and kits

//The codes use IR remote code from Ken Shirriff (see footer)
//Install the libraries by following "IR remote" tutorial above

#include <IRremote.h>
#include <avr/pgmspace.h>

//IR remote globals
int RECV_PIN = 5;
IRrecv irrecv(RECV_PIN);
decode_results results;
int pat_select;

//Interrupt globals
int int0 = 0; //interrupt 0 is on pin 5 on the Teensy;
volatile int state = LOW; //'volatile' is necessary for interrupts

//Lasers globals
int n_lasers = 14;
int laser[] = {23,16,15,10,8,7,9,14,13,12,11,22,6,4};//remaps the Teensy pin numbers to consecutive laser numbers

//animation globals
unsigned long j=0;
int frame_offset=0;
unsigned long frame_length = 20;
int frame_count = 6;
unsigned long loop_length = frame_count*frame_length;

//preset patterns - storing in flash memory requires "const uint16_t" datatype, "extern" means the initializations are in the other tab
//to make a new pattern go to "preset_patterns" tab, create an array like laser_frames[] and add it to the pointer array seq_select[] and array seq_length[]
extern const uint16_t  laser_frames1[];
extern const uint16_t  laser_frames2[];
extern const uint16_t  laser_frames3[];
extern const uint16_t  laser_frames4[];
extern const uint16_t* seq_select[];
extern int seq_lengths[];
extern int seq_count;

extern const uint16_t laser_pixels[1000]; //pixel buffer, gets animated in the main loop
                   
void setup()
{
 //IR setup
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 pat_select = 0;
 
 //Interrupt setup
 attachInterrupt(int0,stateChange,CHANGE);
 
 //Laser setup
 for (int i=0;i<n_lasers;i++){
   pinMode(laser[i],OUTPUT);
 }
 //other pin setup
 pinMode(0,OUTPUT);
 pinMode(1,OUTPUT);
 pinMode(2,OUTPUT);
 pinMode(21,OUTPUT);
 
}

void loop() {
 //main animation loop
 frame_offset=0;
 for (int j=0;j<loop_length;j++){ //loop length is in units of "cycles"
     int IR_status=state; //for checking IR button presses
     
     load_sequence(seq_select[pat_select],laser_pixels,seq_lengths[pat_select]/sizeof(int)); //loads each "frame" ("laser_frames[]") into pixel buffer ("laser_pixels[]")
     
     for (int i=0;i<(n_lasers);i++){ //"draws" the frame
       if (laser_pixels[i+frame_offset]==1) digitalWrite(laser[i],HIGH);
       else digitalWrite(laser[i],LOW);
     }
     
     if (j%(frame_length)==frame_length-1) frame_offset+=n_lasers; //move to the start address of the next frame
   
     if (state!=IR_status) break; //"state" is tied to the external interupt so pressing a remote button press will exit the loop
 }
}
//Load frame sequence
void load_sequence(const uint16_t  source[], const uint16_t destination[], int pixel_count){
 for (int i=0;i<(pixel_count);i++){
   destination[i]=pgm_read_word_near(&source[i]);
 }
 loop_length=pixel_count/n_lasersframe_length;
}
//Interrupt function
void stateChange(){
 if (irrecv.decode(&results)) { //decode incoming IR signal and store in 'results'
   Serial.println(results.value, HEX);
   irrecv.resume(); // Receive the next value
 }
 
 switch(results.value){  
     case 0xFD00FF:
     {
       Serial.println("VOL-"); //useful for debug
       if (frame_length>100) frame_length-=100;
       loop_length = frame_count
frame_length;
       results.value = 0x00;
     }
     break;
     case 0xFD40BF:
     {
       Serial.println("VOL+");
       frame_length+=100;
       loop_length = frame_count*frame_length;
       results.value = 0x00;
     }
     break;
     case 0xFDA05F:
     {
       Serial.println("UP");
       if (pat_select < seq_count-1)  pat_select++;
       results.value = 0x00;
     }
     break;
     case 0xFDB04F:
     {
       Serial.println("DOWN");
       if (pat_select>0) pat_select--;      
       results.value = 0x00;
     }
     break;
         
 }
 state = !state;
}

/FOOTER/
/*

  • IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
  • An IR detector/demodulator must be connected to the input RECV_PIN.
  • Version 0.1 July, 2009
  • Copyright 2009 Ken Shirriff
  • http://arcfn.com
    /

    ```

The first message is just warning you that 'j' is a signed int and 'loop_length' is an unsigned long. Perhaps you should make 'j' an unsigned long.

The second and third messages are in load_sequence(). It looks like 'destination' (a.k.a. laser_pixels) should not be in PROGMEM because you can't write into PROGMEM.

prog_uint16_t laser_pixels[1000]; //pixel buffer, gets animated in the main loop

should be

uint16_t laser_pixels[1000]; //pixel buffer, gets animated in the main loop

and

//Load frame sequence
void load_sequence(prog_uint16_t  source[], prog_uint16_t destination[], int pixel_count){

should be

//Load frame sequence
void load_sequence(prog_uint16_t  source[], uint16_t destination[], int pixel_count){