C:\Users\tagadac\AppData\Local\Temp\ccOy0OiH.ltrans0.ltrans.o: In function `setup':
c:\Users\tagadac\Documents\Arduino\BQ2060Av1/BQ2060Av1.ino:5: undefined reference to `i2c_init()'
collect2.exe: error: ld returned 1 exit status
exit status 1
[Error] Exit with code=1
It's pretty confusing... I tried to rename "twimaster.c" to "i2cmaster.c" but (obviously) same error.
Due to the file extension of twimaster.c, this code is compiled as C. But the Arduino IDE's .ino sketch files are actually compiled as C++, after some minor preprocessing (mostly just generating function prototypes). so you must wrap the #include directive in extern "C" {}:
pert:
Due to the file extension of twimaster.c, this code is compiled as C. But the Arduino IDE's .ino sketch files are actually compiled as C++, after some minor preprocessing (mostly just generating function prototypes). so you must wrap the #include directive in extern "C" {}: