Error in program 'RAWBUF' was not declared in this scope

I have got a problem in program from git.hub, i downloaded the code and then this error start show up, i dont know where is the problem, Please help!

git.hub project: GitHub - illuminateddan/Laser-X-Hacks: A hack of the Laser X, laser tag system

code:

/*

  • LASER X Land Mine Code
  • Designed for use with the Laser X “laser” (infrared) shooting game.
  • This code requires a PIR, an IR receiver, an IR LED (or multiple with a transistor), an RGB led,
  • and probably batteries and a project box etc, etc
  • Game Play:
  • A player shoots the circuit, arming the mine for their team. A brief countdown begins and then the circuit fires
  • multiple “shots” (the teams IR code - The unit fires back the activating IR signal).
  • Red team kills blue,
  • blue team kills red
  • Renegade kills everyone including itself
    */

#define redPin 11
#define greenPin 10
#define bluePin 9
#define PIRPin 12
#define ledPin 13

#include <IRremote.h>
int RECV_PIN = 2;
IRsend irsend;////An IR LED must be connected to Arduino PWM pin 3.
IRrecv irrecv(RECV_PIN);
decode_results results;

int codeType = -1; // The type of code
unsigned int rawCodes[RAWBUF]; // The durations if raw
int codeLen; // The length of the code

// IR codes for Laser X units
unsigned int teamA = {6050, 650, 400, 600, 1450, 600, 450, 600, 1450, 600, 450, 600, 400, 600, 1400, 650, 450};
unsigned int teamB = {6150, 550, 450, 600, 1450, 600, 400, 650, 1450, 550, 450, 600, 450, 550, 450, 600, 1400};
unsigned int renegade = {6100, 600, 450, 550, 1450, 600, 450, 600, 1450, 600, 450, 550, 400, 650, 1450, 600, 1500};

// 33EBDD7B - 871095675 A
// A3F34992 - 2750630290 B
// 33EBDD7A - 871095674 Renegade

int attackState = 0; // (0 everyone, 1 reds own, 2 blues own)
int attackTimes = 5;
bool active = 0;

long timer = 0;
int duration = 10000;

void setup() {
Serial.begin(115200);
Serial.println(“Hello! Laser X Mine!”);
irrecv.enableIRIn(); // Start the receiver

pinMode(ledPin, OUTPUT);
pinMode(PIRPin, INPUT);
digitalWrite(ledPin, HIGH);

pinMode(3, OUTPUT);
digitalWrite(3, HIGH);
delay(3000);
digitalWrite(3, LOW);

digitalWrite(ledPin, LOW);
setLEDFlash(255, 0, 0, 1, 100);
setLEDFlash(0, 255, 0, 1, 100);
setLEDFlash(0, 0, 255, 1, 100);

} // setup ------------------------------------------------------------

void loop() {

bool PIRState = digitalRead(PIRPin);
digitalWrite(ledPin, PIRState);

Serial.print(“Active:”); Serial.print(active);
Serial.print(" attackState:"); Serial.print(attackState);
Serial.print(" PIR:"); Serial.println(PIRState);

if (active) {
Serial.print(“Active so…”);
if (PIRState) {
Serial.print("Movement Detected: Attack ");
switch (attackState) {
case 0:
sendRenegade(attackTimes);
active = 0;
attackState = 0;
irrecv.enableIRIn(); // Re-enable receiver
break;
case 1:
sendTeamA(attackTimes);
active = 0;
attackState = 0;
irrecv.enableIRIn(); // Re-enable receiver
break;
case 2:
sendTeamB(attackTimes);
active = 0;
attackState = 0;
irrecv.enableIRIn(); // Re-enable receiver
break;
} // PIR state

} // if PIR
} // active

if (!active) {

if (irrecv.decode(&results)) {
Serial.println(“results in…”);
storeCode(&results);
// irrecv.resume(); // resume receiver
//Serial.println(results.value, HEX);
Serial.print(results.value);
Serial.print(" - ");
irrecv.resume(); // resume receiver NOTE: NEEDS TIME TO DO OTHER STUFF BEFORE PROCESSING IR OR YOU GET BAD CODES

switch (results.value) {
case 871095675:
Serial.println(“Red Team Hit”);
setLEDFlash(255, 0, 0, 5, 500);
setLEDFlash(255, 0, 0, 5, 200);
setLEDFlash(255, 0, 0, 5, 100);
setLED(255, 0, 0);
attackState = 1;
active = 1;
break;
case 2750630290:
Serial.println(“Blue Team Hit”);
setLEDFlash(0, 0, 255, 5, 500);
setLEDFlash(0, 0, 255, 5, 200);
setLEDFlash(0, 0, 255, 5, 100);
setLED(0, 0, 255);
attackState = 2;
active = 1;
break;
case 871095674:
Serial.println(“Renegade Hit”);
setLEDFlash(255, 0, 255, 5, 500);
setLEDFlash(255, 0, 255, 5, 200);
setLEDFlash(255, 0, 255, 5, 100);
setLED(255, 0, 255);
attackState = 0;
active = 1;
break;
default :
Serial.println("Not recognised ");
setLEDFlash(0, 255, 0, 10, 200);
setLED(0, 255, 0);
attackState = 0;
active = 0;
break;
}// switch

} // if receive
} //not active

} // loop ------------------------------------------------------------

void storeCode(decode_results * results) {
codeType = results->decode_type;
int count = results->rawlen;
if (codeType == UNKNOWN) {
//Serial.println(“Received unknown code, saving as raw”);
codeLen = results->rawlen - 1;
// To store raw codes:
// Drop first value (gap)
// Convert from ticks to microseconds
// Tweak marks shorter, and spaces longer to cancel out IR receiver distortion
for (int i = 1; i <= codeLen; i++) {
if (i % 2) {
// Mark
rawCodes[i - 1] = results->rawbuf * USECPERTICK - MARK_EXCESS;

  • //Serial.print(" m");*
  • } else { // i%2*
  • // Space*
    rawCodes[i - 1] = results->rawbuf * USECPERTICK + MARK_EXCESS;
    * //Serial.print(" s");*
    * }*
    * //Serial.print(rawCodes[i - 1], DEC);*
    * }*
    * //Serial.println("");*
    * } // if codetype unknown*
    }
    void sendCode() { // used to bounce back the IR code
    _ if (codeType == UNKNOWN /* i.e. raw /) {_
    _
    irsend.sendRaw(rawCodes, codeLen, 38); // Assume 38 KHz*_
    * Serial.println(“Sent raw”);*
    * }*
    } // void
    void sendTeamA(int _times) {
    * for (int i = 0; i < times; i++) {
    _
    setLED(255, 255, 255);*

    * irsend.sendRaw(teamA, sizeof(teamA) / sizeof(teamA[0]), 38); // Assume 38 KHz*
    * Serial.println(“Sent Team A Fire Code”);*
    * delay(1000);*
    * setLED(0, 0, 0);*
    * delay(500);*
    * }*
    }
    void sendTeamB(int _times) {
    * for (int i = 0; i < times; i++) {
    _
    setLED(255, 255, 255);*

    * irsend.sendRaw(teamB, sizeof(teamB) / sizeof(teamB[0]), 38); // Assume 38 KHz*
    * Serial.println(“Sent Team B Fire Code”);*
    * delay(1000);*
    * setLED(0, 0, 0);*
    * delay(500);*
    * }*
    }
    void sendRenegade(int _times) {
    * for (int i = 0; i < times; i++) {
    _
    setLED(255, 255, 255);*

    * irsend.sendRaw(renegade, sizeof(renegade) / sizeof(renegade[0]), 38); // Assume 38 KHz*
    * Serial.println(“Sent Renegade Fire Code”);*
    * delay(1000);*
    * setLED(0, 0, 0);*
    * delay(500);*
    * }*
    }
    void setLED(int _r, int _g, int _b) {
    * analogWrite(redPin, _r);
    analogWrite(greenPin, _g);
    analogWrite(bluePin, b);
    _
    }*

    void setLEDFlash(int _r, int _g, int _b, int _times, int _delay) {
    * for (int i = 0; i < _times; i++) {
    analogWrite(redPin, _r);
    analogWrite(greenPin, _g);
    analogWrite(bluePin, _b);
    delay(delay);
    _
    analogWrite(redPin, 0);*

    * analogWrite(greenPin, 0);*
    * analogWrite(bluePin, 0);*
    * delay(delay);
    _
    }*

    }

What version of the IRremote library do you have installed? If it is the latest version, you will have more trouble than just the RAWBUF issue. You will need to delete the installation of the IRremote library and install an older version. Older versions are available via the IDE library manager.

@wpmeback

Please follow the advice on posting code given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

If the code exceeds the 9000 character inline limit then attach it to a post

ok but can i ask you about something more, my led doesnt work. It doesnt send ir code, i dont know what to do Pls can you help me?

Have you checked to see if the IR LED is operating at all? Most cell phone cameras are sensitive to IR light. You should see a flashing blue light while the IR LED is sending.

I dont know how to check that

Look at the LED with the camera on your cell phone with the power to the Arduino on and off

Can you tell me how to make circuit to test my led?

wpmeback:
Can you tell me how to make circuit to test my led?

Yes, but that means you will need some method of testing your test circuit.
A camera (that you can test with a TV remote) is much simpler.

Is the LED in a remote control of some kind or is it a standalone IR LED ?

Here is a circuit and code to test the function of an IR LED.

Load and run this code after wiring as shown. View the LED with the camera and watch for the 1 second on and 1 second off LED flash.

const byte ledPin = 2;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(ledPin, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(ledPin, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

do i need a sender diode to transmit ir signal or can i use regular led?

You need an IR LED to send IR signals that an IR receiver can pick up.

transmitter diode?

wpmeback: do i need a sender diode to transmit ir signal or can i use regular led?

You need an LED that emits IR. Does a regular LED emit IR and, if so, does it emit IR with sufficient power ?