Bonjour, problème de compilation

Voici l'erreur :

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h: In member function 'void USBKeyboard::sendKeyStroke(byte, byte)':

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:32:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Reserved

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:32:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:34:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Keycode 2  

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:34:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:35:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Keycode 3

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:35:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:36:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Keycode 4

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:36:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:37:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Keycode 5

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:37:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

In file included from C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:2:0:

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:38:22: error: call of overloaded 'write(int, int)' is ambiguous

     Serial.write(0, 1);          // Keycode 6  

                      ^

C:\Users\user\Documents\Arduino\libraries\USBKeyboard-master/USBKeyboard.h:38:22: note: candidates are:

In file included from E:\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

                 from E:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,

                 from sketch\sketch_feb18a.ino.cpp:1:

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: size_t Print::write(const char*, size_t)

     size_t write(const char *buffer, size_t size) {

            ^

E:\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: virtual size_t Print::write(const uint8_t*, size_t)

     virtual size_t write(const uint8_t *buffer, size_t size);

                    ^

C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino: In function 'void setup()':

C:\Users\user\Documents\Arduino\sketch_feb18a\sketch_feb18a.ino:5:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  Keyboard.print("Coucou");

                         ^

exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno

Si on doit deviner quelles sont les lignes de code qui génèrent les messages d'erreur, tu trouvera toutes les réponses ici

Bonjour,

Voir l'utilisation de write.

Bonjour j'ai eu le même problème et vos solutions marchent
Merci