\$\begingroup\$
\$\endgroup\$
2
I am using the board STM32F3 and I am trying to establish I2C communication between the microcontroller and the accelerometer LSM303DLHC by using the HAL functions. This is the code:
uint8_t IC[4];
#define acc 0b0011001
IC[0] = 0x20; // register adress
IC[1] = 0x87; // data to write
HAL_I2C_Master_Transmit(&hi2c1, acc<<1, IC, 2, 10);
When I compile, I obtain the following errors:
error: #165: too few arguments in function call
error: #18: expected a ")"
I have no idea how to debug this code, can someone help me?
Blup1980
6,9603 gold badges30 silver badges49 bronze badges
1 Answer 1
\$\begingroup\$
\$\endgroup\$
1
Your compiler does not support binary literals. Change the define to hex or decimal.
answered Jan 10, 2019 at 14:34
-
\$\begingroup\$ Thank you! It was exactly that problem and now it is solved ;) \$\endgroup\$emdezla– emdezla2019年01月12日 08:01:05 +00:00Commented Jan 12, 2019 at 8:01
lang-c
#include
s. Smells like some stray(
or semicolon. \$\endgroup\$