[SOLVED] I2CMaster Lib hangs my Arduino

Hi,

I am using an Arduino Nano.

I have just installed I2CMaster from Peter Fleury : http://homepage.hispeed.ch/peterfleury/i2cmaster.zip

I managed to install it properly (I installed it with the zip option, and deleting the .S file, changed the frequency to 16MHz in twimaster.c) and my sketch compiles.

But the problem is that my program never start when I transfer it to my board.

Ex :

void setup() {
  Serial.begin(9600);

  while (!Serial);

  Serial.print("Hello");

}

void loop() {
 
}

Works like a charm, when I open the serial Term I can see my message.
But if I add this :

#include <i2cmaster.h>

Nothing happened...

Thanks for your help

Please describe exactly the steps you followed to install the library.

I have a suspicion of what the problem is, but I need to reproduce your installation exactly to confirm.

Thank you for your help.

I downloaded the lib, I installed it by doing :

Arduino IDE --> Sketch --> Include Library --> From ZIP file (My IDE is not in English so it may differ)

I selected the zip file, then I went to "C:\Program Files (x86)\Arduino\libraries\i2cmaster" and I deleted the i2cmaster.S file.

From here I can compile and transfer my sketch, but nothing happens.

I tried using VisualStudio Code with Arduino plugin but I have the same problem.

You also need to delete C:\Program Files (x86)\Arduino\libraries\i2cmaster\test_i2cmaster.c. This file is not actually part of the i2cmaster library, but if it's in the library folder it gets compiled. test_i2cmaster.c is a test program that uses the library. This file defines a main() function, which overrides the Arduino core library's main() function. The Arduino core library's main() is what calls the setup() and loop() functions in your sketch. So when the Arduino core library's main() is overridden, it causes your sketch to not run.

Whoopsy.. Indeed this was OBVIOUS.

Thank you very much !