exit status 1 expected identifier before numeric constant

Hello, I have this error happening in the code i am writing for a quadruped ( not mine, its kame code modified by me), it signals this parts:

define FRONT_RIGHT_HIP 0];

define FRONT_LEFT_HIP 1];

define FRONT_RIGHT_LEG 2];

define FRONT_LEFT_LEG 3];

define BACK_RIGHT_HIP 4];

define BACK_LEFT_HIP 5];

define BACK_RIGHT_LEG 6];

define BACK_LEFT_LEG 7];

I dont know what is happening.

Heres the whole code

main:

#include <Arduino.h>
#include “MiniKame.h”
#include <SoftwareSerial.h>
SoftwareSerial BT1(10,11); // RX, TX recordar que se cruzan

char data;
int FRONT_RIGHT_HIP = 2;
int FRONT_LEFT_HIP = 8;
int BACK_RIGHT_HIP = 4;
int BACK_LEFT_HIP = 6;
int FRONT_RIGHT_LEG = 3;
int FRONT_LEFT_LEG = 9;
int BACK_RIGHT_LEG = 5;
int BACK_LEFT_LEG = 7;

//uncomment out below line if you want to use HC_SR04 sensor
//#define HC_SR04

#ifdef HC_SR04
#define HC_SR04_TRIGGER_PIN 10
#define HC_SR04_ECHO_PIN 11
#define MIN_DISTANCE 10
#define MAX_DISTANCE MIN_DISTANCE + 10
#endif

#define CAL_TRIGGER_PIN 12
#define LED_PIN A0
#define TIME_INTERVAL 5000

#define FORWARD ‘a’
#define LEFT ‘b’
#define STAND ‘c’
#define RIGHT ‘d’
#define BACKWARD ‘e’
#define GO ‘f’
#define RIGHT_FRONT ‘g’
#define RIGHT_BACK ‘h’
#define LEFT_FRONT ‘i’
#define LEFT_BACK ‘j’

MiniKame robot;

volatile boolean auto_mode = true;
bool state = true;
char cmd = STAND;
boolean random_walk = true;

void setup() {

BT1.begin(9600);
pinMode(FRONT_RIGHT_HIP,OUTPUT);
pinMode(FRONT_LEFT_HIP,OUTPUT);
pinMode(BACK_RIGHT_HIP,OUTPUT);
pinMode(BACK_LEFT_HIP,OUTPUT);
pinMode(FRONT_RIGHT_LEG,OUTPUT);
pinMode(FRONT_LEFT_LEG,OUTPUT);
pinMode(BACK_RIGHT_LEG,OUTPUT);
pinMode(BACK_LEFT_LEG,OUTPUT);

if(bluetooth.available()> 0 )

Serial.begin(115200);

#ifdef HC_SR04
pinMode(HC_SR04_TRIGGER_PIN, OUTPUT);
pinMode(HC_SR04_ECHO_PIN, INPUT);
#endif
randomSeed(analogRead(A7));

//
robot.init();
delay(2000);

//begin: triggering delay for servo calibrating
pinMode(CAL_TRIGGER_PIN, OUTPUT);
digitalWrite(CAL_TRIGGER_PIN, 0);
pinMode(CAL_TRIGGER_PIN, INPUT);
while (digitalRead(CAL_TRIGGER_PIN)) {
analogWrite(LED_PIN, 128 * state); // on calibarting indication LED
delay(1000);
state = !state;
}
analogWrite(LED_PIN, 0); // off calibarting indication LED
//end:
}

void loop() {
if (auto_mode) {
if (random_walk)
gaits2(0);
else
gaits2(1);
} else {
gaits(cmd);
}
}

void serialEvent() {
char tmp = -1;
boolean taken = false;

while (Serial.available()) {
state = !state;
analogWrite(LED_PIN, 128 * state); //flashing LED indicating cmd received
tmp = Serial.read (); //Serial.println(cmd);
not_gaits(tmp);
taken = gaits(tmp);
if (taken) cmd = tmp;
}
}

boolean gaits(char cmd) {
bool taken = true;
switch (cmd) {
case GO:
robot.walk();
break;
case FORWARD:
robot.walk();
break;
case BACKWARD:
//robot.run(0);
robot.walk(0);
break;
case RIGHT:
robot.turnR(1, 550);
break;
case LEFT:
robot.turnL(1, 550);
break;
case RIGHT_FRONT:
robot.turnR(1, 550);
robot.walk();
break;
case RIGHT_BACK:
robot.turnR(1, 550);
robot.walk(0);
break;
case LEFT_FRONT:
robot.turnL(1, 550);
robot.walk();
break;
case LEFT_BACK:
robot.turnL(1, 550);
robot.walk(0);
break;
case STAND:
robot.home();
break;
default:
taken = false;
}
return taken;
}

void not_gaits(char cmd) {
static short receivedNumber = 0;
static bool negative = false;
static byte channel = 1;

switch (cmd) {
case ‘L’:
robot.loadTrim();
break;
case ‘S’:
robot.storeTrim();
break;
case ‘<’: // fall through to start a new number with prefix x,y char
receivedNumber = 0;
channel = 0;
negative = false;
break;
case ‘x’:
channel = 1;
break;
case ‘y’:
channel = 2;
break;
case ‘z’:
channel = 3;
break;
case ‘Z’:
channel = 4;
break;
case ‘a’:
channel = 5;
break;
case ‘A’:
channel = 6;
break;
case ‘0’ … ‘9’:
receivedNumber *= 10;
receivedNumber += cmd - ‘0’;
break;
case ‘-’:
negative = true;
break;
case ‘>’: // end of getting a number in format of <[x,y,z,a]number>
if (negative) receivedNumber = -receivedNumber;
switch (channel) {
case 1:
if (receivedNumber >= 127) {
state = auto_mode = false;
analogWrite(LED_PIN, 0);
robot.home();
}
else {
state = auto_mode = true;
analogWrite(LED_PIN, 128);
}
break;
case 2:
if (receivedNumber >= 127)
random_walk = false;
else
random_walk = true;
break;
case 3:
if (auto_mode) break;
robot.setTrim(FRONT_RIGHT_HIP, receivedNumber);
robot.home();
break;
case 4:
if (auto_mode) break;
robot.setTrim(FRONT_LEFT_HIP, receivedNumber);
robot.home();
break;
case 5:
if (auto_mode) break;
robot.setTrim(BACK_RIGHT_HIP, receivedNumber);
robot.home();
break;
case 6:
if (auto_mode) break;
robot.setTrim(BACK_LEFT_HIP, receivedNumber);
robot.home();
break;
} // end of inner switch
break;
} // end of switch

}

void gaits2(int pattern) {
char movements = {FORWARD, LEFT, STAND, RIGHT, BACKWARD, RIGHT_FRONT, RIGHT_BACK, LEFT_FRONT, LEFT_BACK, GO};
char movements2 = {FORWARD, LEFT, FORWARD, RIGHT};
static unsigned long cur_time = 0, prev_time = 0;
static char cmd = FORWARD, prev_cmd = -1;
static int c = 0;

cur_time = millis();
if (cur_time - prev_time >= TIME_INTERVAL) {
prev_time = cur_time;
do {
switch (pattern) {
case 0: c = (int)random(0, sizeof(movements));
cmd = movements

;
         break;
       case 1:  c = c % sizeof(movements2);
         cmd = movements2[c++];
         break;
       default:
         pattern = 0;
     }
   } while (cmd == prev_cmd);
   prev_cmd = cmd; //Serial.println(cmd);
 }
#ifdef __HC_SR04__
 cmd = detect_obstacle(cmd);
#endif
 switch (cmd) {
   case GO:
     robot.pushUp(2, 5000);
     break;
   case FORWARD:
     robot.run();
     break;
   case BACKWARD:
     robot.run(0);
     break;
   case RIGHT:
     robot.turnR(1, 550);
     break;
   case LEFT:
     robot.turnL(1, 550);
     break;
   case RIGHT_FRONT:
     robot.hello();
     break;
   case LEFT_FRONT:
     robot.dance(2, 1000);
     break;
   case RIGHT_BACK:
     robot.frontBack(2, 1000);
     break;
   case LEFT_BACK:
     robot.moonwalkL(4, 2000);
     break;
   case STAND:
     robot.upDown(4, 250);
     break;
 }
}


#ifdef __HC_SR04__
char detect_obstacle(char cmd) {
 char i = cmd;
 long cm = distance_measure();
 if (cm < MIN_DISTANCE) {
   i = STAND;
 } else if (cm >= MIN_DISTANCE && cm <= MAX_DISTANCE) {
   i = BACKWARD;
 }
 return i;
}

long distance_measure()
{
 // establish variables for duration of the ping,
 // and the distance result in inches and centimeters:
 long duration, cm;

 // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
 // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:

 digitalWrite(HC_SR04_TRIGGER_PIN, LOW);
 delayMicroseconds(2);
 digitalWrite(HC_SR04_TRIGGER_PIN, HIGH);
 delayMicroseconds(5);
 digitalWrite(HC_SR04_TRIGGER_PIN, LOW);

 // The same pin is used to read the signal from the PING))): a HIGH
 // pulse whose duration is the time (in microseconds) from the sending
 // of the ping to the reception of its echo off of an object.
 duration = pulseIn(HC_SR04_ECHO_PIN, HIGH);

 // The speed of sound is 340 m/s or 29 microseconds per centimeter.
 // The ping travels out and back, so to find the distance of the
 // object we take half of the distance travelled.
 cm =  duration / 29 / 2;
 //Serial.print(cm);
 //Serial.println("cm");
 // delay(100);
 return cm;
}
#endif
Minikame.cpp:

#include <EEPROM.h>
#include "MiniKame.h"
/*
(servo index, pin to attach pwm)
__________ __________ _________________
|(3,9)_____)(1,8)      (0,2)(______(2,3)|
|__|       |left FRONT right|        |__|
         |                |
         |                |
         |                |
_________ |                | __________
|(7,7)_____)(5,6)______(4,4)(______(6,5)|
|__|                                 |__|

*/
//comment below manually setting trim in MiniKame() constructor
#define __LOAD_TRIM_FROM_EEPROM__

#define EEPROM_MAGIC  0xabcd

#define EEPROM_OFFSET 2   //eeprom starting offset to store trim[]


MiniKame::MiniKame(): reverse{0, 0, 0, 0, 0, 0, 0, 0}, trim{0, 0, 0, 0, 0, 0, 0, 0} {

board_pins,[FRONT_RIGHT_HIP] = (2); // front left inner

board_pins,[FRONT_LEFT_HIP] = (8); // front right inner

board_pins,[BACK_RIGHT_HIP] = (4); // back left inner

board_pins,[BACK_LEFT_HIP] = (6); // back right inner

board_pins,[FRONT_RIGHT_LEG] = (3); // front left outer

board_pins,[FRONT_LEFT_LEG] = (9); // front right outer

board_pins,[BACK_RIGHT_LEG] = (5); // back left outer

poard_pins,[BACK_LEFT_LEG] = (7); // back right outer
}

void MiniKame::init() {
/*
 trim[] for calibrating servo deviation,
 initial posture (home) should like below
 in symmetric
    \       /
     \_____/
     |     |
     |_____|
     /     \
    /       \
*/
/*
trim[FRONT_LEFT_HIP] = 0;
trim[FRONT_RIGHT_HIP] = -8;
trim[BACK_LEFT_HIP] = 8;
trim[BACK_RIGHT_HIP] = 5;

trim[FRONT_LEFT_LEG] = 2;
trim[FRONT_RIGHT_LEG] = -6;
trim[BACK_LEFT_LEG] = 6;
trim[BACK_RIGHT_LEG] = 5;
*/
#ifdef __LOAD_TRIM_FROM_EEPROM__
int val = EEPROMReadWord(0);
if (val != EEPROM_MAGIC) {
EEPROMWriteWord(0, EEPROM_MAGIC);
storeTrim();
}
#endif

(I am not scrolling thru that again - Moderator)

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:

[code]

[color=blue]// your code is here[/color]

[/code]

Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you’re using the Arduino Web Editor you will not have access to this useful tool but it’s still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

#include <Arduino.h>
#include "MiniKame.h"
#include <SoftwareSerial.h>
SoftwareSerial BT1(10,11); // RX, TX recordar que se cruzan

char data;
int FRONT_RIGHT_HIP = 2;
int FRONT_LEFT_HIP = 8;
int BACK_RIGHT_HIP = 4;
int BACK_LEFT_HIP = 6;
int FRONT_RIGHT_LEG = 3;
int FRONT_LEFT_LEG = 9;
int BACK_RIGHT_LEG = 5;
int BACK_LEFT_LEG = 7;

//uncomment out below line if you want to use HC_SR04 sensor
//#define __HC_SR04__

#ifdef __HC_SR04__
#define HC_SR04_TRIGGER_PIN 10
#define HC_SR04_ECHO_PIN 11
#define MIN_DISTANCE 10
#define MAX_DISTANCE MIN_DISTANCE + 10
#endif

#define CAL_TRIGGER_PIN 12
#define LED_PIN A0
#define TIME_INTERVAL 5000

#define FORWARD 'a'
#define LEFT 'b'
#define STAND 'c'
#define RIGHT 'd'
#define BACKWARD 'e'
#define GO 'f'
#define RIGHT_FRONT 'g'
#define RIGHT_BACK 'h'
#define LEFT_FRONT 'i'
#define LEFT_BACK 'j'

MiniKame robot;

volatile boolean auto_mode = true;
bool state = true;
char cmd = STAND;
boolean random_walk = true;

void setup() {
  
   BT1.begin(9600);
        pinMode(FRONT_RIGHT_HIP,OUTPUT);
        pinMode(FRONT_LEFT_HIP,OUTPUT);
        pinMode(BACK_RIGHT_HIP,OUTPUT);
        pinMode(BACK_LEFT_HIP,OUTPUT);
        pinMode(FRONT_RIGHT_LEG,OUTPUT);
        pinMode(FRONT_LEFT_LEG,OUTPUT);
        pinMode(BACK_RIGHT_LEG,OUTPUT);
        pinMode(BACK_LEFT_LEG,OUTPUT);

        if(bluetooth.available()> 0 )
        
  Serial.begin(115200);

#ifdef __HC_SR04__
  pinMode(HC_SR04_TRIGGER_PIN, OUTPUT);
  pinMode(HC_SR04_ECHO_PIN, INPUT);
#endif
  randomSeed(analogRead(A7));

  //
  robot.init();
  delay(2000);

  //begin: triggering delay for servo calibrating
  pinMode(CAL_TRIGGER_PIN, OUTPUT);
  digitalWrite(CAL_TRIGGER_PIN, 0);
  pinMode(CAL_TRIGGER_PIN, INPUT);
  while (digitalRead(CAL_TRIGGER_PIN)) {
    analogWrite(LED_PIN, 128 * state); // on calibarting indication LED
    delay(1000);
    state = !state;
  }
  analogWrite(LED_PIN, 0); // off calibarting indication LED
  //end:
}

void loop() {
  if (auto_mode) {
    if (random_walk)
      gaits2(0);
    else
      gaits2(1);
  } else {
    gaits(cmd);
  }
}

void serialEvent() {
  char tmp = -1;
  boolean taken = false;

  while (Serial.available()) {
    state = !state;
    analogWrite(LED_PIN, 128 * state); //flashing LED indicating cmd received
    tmp = Serial.read (); //Serial.println(cmd);
    not_gaits(tmp);
    taken = gaits(tmp);
    if (taken) cmd = tmp;
  }
}


boolean  gaits(char cmd) {
  bool taken = true;
  switch (cmd) {
    case GO:
      robot.walk();
      break;
    case FORWARD:
      robot.walk();
      break;
    case BACKWARD:
      //robot.run(0);
      robot.walk(0);
      break;
    case RIGHT:
      robot.turnR(1, 550);
      break;
    case LEFT:
      robot.turnL(1, 550);
      break;
    case RIGHT_FRONT:
      robot.turnR(1, 550);
      robot.walk();
      break;
    case RIGHT_BACK:
      robot.turnR(1, 550);
      robot.walk(0);
      break;
    case LEFT_FRONT:
      robot.turnL(1, 550);
      robot.walk();
      break;
    case LEFT_BACK:
      robot.turnL(1, 550);
      robot.walk(0);
      break;
    case STAND:
      robot.home();
      break;
    default:
      taken = false;
  }
  return taken;
}

void not_gaits(char cmd) {
  static short receivedNumber = 0;
  static bool negative = false;
  static byte channel = 1;

  switch (cmd) {
    case 'L':
      robot.loadTrim();
      break;
    case 'S':
      robot.storeTrim();
      break;
    case  '<':  // fall through to start a new number with prefix x,y char
      receivedNumber = 0;
      channel = 0;
      negative = false;
      break;
    case 'x':
      channel = 1;
      break;
    case 'y':
      channel = 2;
      break;
    case 'z':
      channel = 3;
      break;
    case 'Z':
      channel = 4;
      break;
    case 'a':
      channel = 5;
      break;
    case 'A':
      channel = 6;
      break;
    case '0' ... '9':
      receivedNumber *= 10;
      receivedNumber += cmd - '0';
      break;
    case '-':
      negative = true;
      break;
    case '>': // end of getting a number in format of <[x,y,z,a]number>
      if (negative) receivedNumber = -receivedNumber;
      switch (channel) {
        case 1:
          if (receivedNumber >= 127) {
            state = auto_mode = false;
            analogWrite(LED_PIN, 0);
            robot.home();
          }
          else {
            state = auto_mode = true;
            analogWrite(LED_PIN, 128);
          }
          break;
        case 2:
          if (receivedNumber >= 127)
            random_walk = false;
          else
            random_walk = true;
          break;
        case 3:
          if (auto_mode) break;
          robot.setTrim(FRONT_RIGHT_HIP, receivedNumber);
          robot.home();
          break;
        case 4:
          if (auto_mode) break;
          robot.setTrim(FRONT_LEFT_HIP, receivedNumber);
          robot.home();
          break;
        case 5:
          if (auto_mode) break;
          robot.setTrim(BACK_RIGHT_HIP, receivedNumber);
          robot.home();
          break;
        case 6:
          if (auto_mode) break;
          robot.setTrim(BACK_LEFT_HIP, receivedNumber);
          robot.home();
          break;
      }  // end of inner switch
      break;
  } // end of switch

}

void gaits2(int pattern) {
  char movements[] = {FORWARD, LEFT, STAND, RIGHT, BACKWARD, RIGHT_FRONT, RIGHT_BACK, LEFT_FRONT, LEFT_BACK, GO};
  char movements2[] = {FORWARD, LEFT, FORWARD,  RIGHT};
  static unsigned long cur_time = 0, prev_time = 0;
  static char cmd = FORWARD, prev_cmd = -1;
  static int c = 0;

  cur_time = millis();
  if (cur_time - prev_time >= TIME_INTERVAL) {
    prev_time = cur_time;
    do {
      switch (pattern) {
        case 0: c = (int)random(0, sizeof(movements));
          cmd = movements[c];
          break;
        case 1:  c = c % sizeof(movements2);
          cmd = movements2[c++];
          break;
        default:
          pattern = 0;
      }
    } while (cmd == prev_cmd);
    prev_cmd = cmd; //Serial.println(cmd);
  }
#ifdef __HC_SR04__
  cmd = detect_obstacle(cmd);
#endif
  switch (cmd) {
    case GO:
      robot.pushUp(2, 5000);
      break;
    case FORWARD:
      robot.run();
      break;
    case BACKWARD:
      robot.run(0);
      break;
    case RIGHT:
      robot.turnR(1, 550);
      break;
    case LEFT:
      robot.turnL(1, 550);
      break;
    case RIGHT_FRONT:
      robot.hello();
      break;
    case LEFT_FRONT:
      robot.dance(2, 1000);
      break;
    case RIGHT_BACK:
      robot.frontBack(2, 1000);
      break;
    case LEFT_BACK:
      robot.moonwalkL(4, 2000);
      break;
    case STAND:
      robot.upDown(4, 250);
      break;
  }
}


#ifdef __HC_SR04__
char detect_obstacle(char cmd) {
  char i = cmd;
  long cm = distance_measure();
  if (cm < MIN_DISTANCE) {
    i = STAND;
  } else if (cm >= MIN_DISTANCE && cm <= MAX_DISTANCE) {
    i = BACKWARD;
  }
  return i;
}

long distance_measure()
{
  // establish variables for duration of the ping,
  // and the distance result in inches and centimeters:
  long duration, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:

  digitalWrite(HC_SR04_TRIGGER_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(HC_SR04_TRIGGER_PIN, HIGH);
  delayMicroseconds(5);
  digitalWrite(HC_SR04_TRIGGER_PIN, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  duration = pulseIn(HC_SR04_ECHO_PIN, HIGH);

  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  cm =  duration / 29 / 2;
  //Serial.print(cm);
  //Serial.println("cm");
  // delay(100);
  return cm;
}
#endif

My code is simply too freaking long, it would be a better solution if I gave you the files

Add those in a folder

MiniKame.cpp (12.6 KB)

MiniKame.h (1.78 KB)

Octosnake.cpp (1.51 KB)

Octosnake.h (955 Bytes)

Proyecto_Ana.ino (7.75 KB)

It would really help us to help you if you post the error message. Please post the whole error message (in code tags).

What did you add to the program that caused this error to pop up?

Paul

It is too long, i have to upload it by parts:

Arduino:1.8.5 (Windows Store 1.8.10.0) (Windows 10), Tarjeta:"Arduino Nano, ATmega328P"

In file included from sketch\MiniKame.cpp:2:0:

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.h:7: error: expected identifier before numeric constant

define FRONT_RIGHT_HIP 0];

^

sketch\MiniKame.cpp:27:15: note: in expansion of macro 'FRONT_RIGHT_HIP'

board_pins,[FRONT_RIGHT_HIP] = (2); // front left inner

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:7: error: expected '{' before ';' token

define FRONT_RIGHT_HIP 0];

^

sketch\MiniKame.cpp:27:15: note: in expansion of macro 'FRONT_RIGHT_HIP'

board_pins,[FRONT_RIGHT_HIP] = (2); // front left inner

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:27: error: expected primary-expression before ']' token

board_pins,[FRONT_RIGHT_HIP] = (2); // front left inner

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:9: error: expected identifier before numeric constant

define FRONT_LEFT_HIP 1];

^

sketch\MiniKame.cpp:29:15: note: in expansion of macro 'FRONT_LEFT_HIP'

board_pins,[FRONT_LEFT_HIP] = (8); // front right inner

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:9: error: expected '{' before ';' token

define FRONT_LEFT_HIP 1];

^

sketch\MiniKame.cpp:29:15: note: in expansion of macro 'FRONT_LEFT_HIP'

board_pins,[FRONT_LEFT_HIP] = (8); // front right inner

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:29: error: expected primary-expression before ']' token

board_pins,[FRONT_LEFT_HIP] = (8); // front right inner

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:15: error: expected identifier before numeric constant

define BACK_RIGHT_HIP 4];

^

sketch\MiniKame.cpp:31:15: note: in expansion of macro 'BACK_RIGHT_HIP'

board_pins,[BACK_RIGHT_HIP] = (4); // back left inner

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:15: error: expected '{' before ';' token

define BACK_RIGHT_HIP 4];

^

sketch\MiniKame.cpp:31:15: note: in expansion of macro 'BACK_RIGHT_HIP'

board_pins,[BACK_RIGHT_HIP] = (4); // back left inner

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:31: error: expected primary-expression before ']' token

board_pins,[BACK_RIGHT_HIP] = (4); // back left inner

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:17: error: expected identifier before numeric constant

define BACK_LEFT_HIP 5];

^

sketch\MiniKame.cpp:33:15: note: in expansion of macro 'BACK_LEFT_HIP'

board_pins,[BACK_LEFT_HIP] = (6); // back right inner

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:17: error: expected '{' before ';' token

define BACK_LEFT_HIP 5];

^

sketch\MiniKame.cpp:33:15: note: in expansion of macro 'BACK_LEFT_HIP'

board_pins,[BACK_LEFT_HIP] = (6); // back right inner

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:33: error: expected primary-expression before ']' token

board_pins,[BACK_LEFT_HIP] = (6); // back right inner

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:11: error: expected identifier before numeric constant

define FRONT_RIGHT_LEG 2];

^

sketch\MiniKame.cpp:35:15: note: in expansion of macro 'FRONT_RIGHT_LEG'

board_pins,[FRONT_RIGHT_LEG] = (3); // front left outer

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:11: error: expected '{' before ';' token

define FRONT_RIGHT_LEG 2];

^

sketch\MiniKame.cpp:35:15: note: in expansion of macro 'FRONT_RIGHT_LEG'

board_pins,[FRONT_RIGHT_LEG] = (3); // front left outer

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:35: error: expected primary-expression before ']' token

board_pins,[FRONT_RIGHT_LEG] = (3); // front left outer

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:13: error: expected identifier before numeric constant

define FRONT_LEFT_LEG 3];

^

sketch\MiniKame.cpp:37:15: note: in expansion of macro 'FRONT_LEFT_LEG'

board_pins,[FRONT_LEFT_LEG] = (9); // front right outer

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:13: error: expected '{' before ';' token

define FRONT_LEFT_LEG 3];

^

sketch\MiniKame.cpp:37:15: note: in expansion of macro 'FRONT_LEFT_LEG'

board_pins,[FRONT_LEFT_LEG] = (9); // front right outer

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:37: error: expected primary-expression before ']' token

board_pins,[FRONT_LEFT_LEG] = (9); // front right outer

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:19: error: expected identifier before numeric constant

define BACK_RIGHT_LEG 6];

^

sketch\MiniKame.cpp:39:15: note: in expansion of macro 'BACK_RIGHT_LEG'

board_pins,[BACK_RIGHT_LEG] = (5); // back left outer

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:19: error: expected '{' before ';' token

define BACK_RIGHT_LEG 6];

^

sketch\MiniKame.cpp:39:15: note: in expansion of macro 'BACK_RIGHT_LEG'

board_pins,[BACK_RIGHT_LEG] = (5); // back left outer

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:39: error: expected primary-expression before ']' token

board_pins,[BACK_RIGHT_LEG] = (5); // back left outer

^

MiniKame.cpp:41: error: 'poard_pins' was not declared in this scope

poard_pins,[BACK_LEFT_LEG] = (7); // back right outer

^

In file included from sketch\MiniKame.cpp:2:0:

MiniKame.h:21: error: expected identifier before numeric constant

define BACK_LEFT_LEG 7];

^

sketch\MiniKame.cpp:41:15: note: in expansion of macro 'BACK_LEFT_LEG'

poard_pins,[BACK_LEFT_LEG] = (7); // back right outer

^

sketch\MiniKame.cpp: In lambda function:

MiniKame.h:21: error: expected '{' before ';' token

define BACK_LEFT_LEG 7];

^

sketch\MiniKame.cpp:41:15: note: in expansion of macro 'BACK_LEFT_LEG'

poard_pins,[BACK_LEFT_LEG] = (7); // back right outer

^

sketch\MiniKame.cpp: In constructor 'MiniKame::MiniKame()':

MiniKame.cpp:41: error: expected primary-expression before ']' token

poard_pins,[BACK_LEFT_LEG] = (7); // back right outer

^

sketch\MiniKame.cpp: In member function 'void MiniKame::hello()':

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

float period[] = {T, T, T, T, T, T, T, T};

^

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp:312:43: warning: narrowing conversion of 'T' from 'int' to 'float' inside { } [-Wnarrowing]

sketch\MiniKame.cpp: In member function 'void MiniKame::jump()':

sketch\MiniKame.cpp:343:23: warning: narrowing conversion of '(ap + 90)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:32: warning: narrowing conversion of '(90 - ap)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:41: warning: narrowing conversion of '(90 - hi)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:50: warning: narrowing conversion of '(hi + 90)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:59: warning: narrowing conversion of '((ap * -3) + 90)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:72: warning: narrowing conversion of '((ap * 3) + 90)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:85: warning: narrowing conversion of '(hi + 90)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

sketch\MiniKame.cpp:343:94: warning: narrowing conversion of '(90 - hi)' from 'int' to 'float' inside { } [-Wnarrowing]

float salto[] = {90 + ap, 90 - ap, 90 - hi, 90 + hi, 90 - ap * 3, 90 + ap * 3, 90 + hi, 90 - hi};

^

exit status 1 expected identifier before numeric constant

Paul_KD7HB:
What did you add to the program that caused this error to pop up?

Paul

I added this to the main and it started a cascade failure:

#include <SoftwareSerial.h>
SoftwareSerial BT1(10,11); // RX, TX recordar que se cruzan

char data;
int FRONT_RIGHT_HIP = 2;
int FRONT_LEFT_HIP = 8;
int BACK_RIGHT_HIP = 4;
int BACK_LEFT_HIP = 6;
int FRONT_RIGHT_LEG = 3;
int FRONT_LEFT_LEG = 9;
int BACK_RIGHT_LEG = 5;
int BACK_LEFT_LEG = 7;

This and many similar lines:

board_pins,[FRONT_LEFT_LEG] = (9);

Why do you have a comma there?

Why is the constant in parentheses?

In my first error it was the only solution for the first problem

What do you think it does?

I am a newbie, I dont know pretty much anything

A friend told me to add that to move the bot by bluethooth

Omega_Cyclops: I am a newbie, I dont know pretty much anything

Then I suggest you start with a less unwieldy and complex project. Work your way through the programming examples that come with the Arduino IDE. Endeavor to really understand them. Google search for “Arduino programming tutorial”, “C language tutorial”, and “C++ language tutorial”. Take the time to learn the syntax of the language.

gfvalvo: Then I suggest you start with a less unwieldy and complex project. Work your way through the programming examples that come with the Arduino IDE. Endeavor to really understand them. Google search for “Arduino programming tutorial”, “C language tutorial”, and “C++ language tutorial”. Take the time to learn the syntax of the language.

Well, then i guess i wrote down wrong, I DO know about proggraming, since that is what I am studing, but when I looked at the whole main, .cpp and. h it became hard as steel to understand, perhaps i am tangling it too much, what do you think?

Omega_Cyclops: I DO know about proggraming, since that is what I am studing ...

Then you should know that you just can't make up your own syntax.

... what do you think?

I already told you.

Well, I just need you to help me to find what the hell is happening. And if you can, solve it. but i should have thouhgt about the syntax earlier