"B1" reserved?!?


hey!

i trying define variables reading i2c connection when stumbled accross seomthing strange... going fine until tried define variable called "b1":

code: [select]

  short ac1 = i2c_read(i2c_address, 0xaa, 2);
  short ac2 = i2c_read(i2c_address, 0xac, 2);
  short ac3 = i2c_read(i2c_address, 0xae, 2);
  unsigned short ac4 = i2c_read(i2c_address, 0xb0, 2);
  unsigned short ac5 = i2c_read(i2c_address, 0xb2, 2);
  unsigned short ac6 = i2c_read(i2c_address, 0xb4, 2);
  short b1 = i2c_read(i2c_address, 0xb6, 2); //troublemaker!
  short b2 = i2c_read(i2c_address, 0xb8, 2);
  short mb = i2c_read(i2c_address, 0xba, 2);
  short mc = i2c_read(i2c_address, 0xbc, 2);
  short md = i2c_read(i2c_address, 0xbe, 2);


i got the following error message:
quote
error: expected unqualified-id before numeric constant

 #define b1 1
note: in expansion of macro 'b1'
i rewrote line several times, checked entire code errors , @ edge of punching laptop when got f***ing genius idea change name of variable xd. fixes it.

so... wanted ask why hell that?

thanks answers in advance! curious hear them :smiley-lol:

i think there's bunch of bx variables defined elsewhere can used binary:
b1, b10, b11, etc. b11111111
vs 0b11111111 the 8 bits in binary, similar 0xff hex.


Arduino Forum > Using Arduino > Programming Questions > "B1" reserved?!?


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'