SO I wrote this program for my gaming setup(leds that change color depending on the program)

 Name:    RGBART.ino
 Created: 1/24/2016 8:31:43 PM
 Author:  matic
String RGBM = "empty"; // string for serial input
int M = 0; // random colour. 0 for no, 1 for yes
void setup() {
  Serial.begin(9600); //start serial port
  Serial.flush(); // clear serial port's buffer

void loop() {
  while (Serial.available() == 0) {
    if (M == 1) {
      //color fade here
      //not ready yet
  // the program send RGB data
  //folowing code converts string RRR,GGG,BBB,M  to the int-s R, G, B, M (RRR = red, 0-255 GGG = green, 0-255 BBB = blue, 0-255 M = random 0-1
  RGBM = Serial.readString(); //gets string from buffer
  String reportString = RGBM; //loads data to reporting string
  Serial.flush(); //clears buffer 
  char R1 = reportString.charAt(1);  // start of 1 str to 4 int-s
  char R2 = reportString.charAt(2);
  char R3 = reportString.charAt(3);
  char G1 = reportString.charAt(5);
  char G2 = reportString.charAt(6);
  char G3 = reportString.charAt(7);
  char B1 = reportString.charAt(9);
  char B2 = reportString.charAt(10);
  char B3 =  reportString.charAt(11);
  char MInt = reportString.charAt(13);  //end 
  int R = ((R1 + R2 + R3)); // makes the red int
  int G = ((G1 + G2 + G3)); // makes the green int
  int B = ((B1 + B2 + B3)); // makes the blue int
  int M = ((MInt)); //makes the random color int
  Serial.print(R+1); //test 
  Serial.print(G+1); // serial port because my RGB LEDs are comming next week
  Serial.print(B+1); // +1 because I wanna make sure that theese are Int-s
// sorryy for my bad English I'm from Slovenia

SO when I upload it I get this error

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:32:0,

from sketch\sketch_jan24a.ino.cpp:1:

C:\Users\matic\Desktop\sketch_jan24a\sketch_jan24a.ino: In function 'void loop()':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/binary.h:31:12: error: expected unqualified-id before numeric constant

define B1 1


C:\Users\matic\Desktop\sketch_jan24a\sketch_jan24a.ino:34:8: note: in expansion of macro 'B1'

char B1 = reportString.charAt(9);


exit status 1 Error compiling

Thanks for help!!!

Sorry for tittle I didn't read the rules

B1 is defined in one of the core files, so you need to use something different. Use meaningful variable names and you won't get this error. blue1 would have been better.

B11 is predefined as the constant 0b11 like many B… names.

Just do not name anything B or A if you want to omit clashes.

Thx you are the best!