Bonjour,
Je me présente : Geoffroy Bouchet de Fareins, alias gdefareins sur le forum LRPresse.
J'ai lu avec attention votre article et je souhaite utiliser ce principe pour commander un tramway, avec, en plus des 2 gares, des arrêts intermédiaires.
Mon niveau de connaissance d'Arduino est plutôt débutant, mais j'ai déjà programmé en langage C, donc je me dis que je devrais pouvoir y arriver.
J'essaie, dans un 1er temps, de réaliser le va et vient ci-dessus, et à lorsque je demande à Arduino de vérifier le code, j'obtiens les messages ci-dessous décrits.
Pourriez-vous m'aider SVP car je ne comprends pas d'où ça vient.
J'ai peur toutefois que le fait d'avoir stocké mes fichiers Arduino sur mon Cloud ne pose difficulté (travaillant sur plusieurs projets Arduino, ça me permet d'un poste à l'autre de m'assurer d'avoir les mêmes bibliothèques)
D'avance, merci à vous
Courtoisement vôtre
Ici les erreurs :
Arduino : 1.8.13 (Windows 10), Carte : "Arduino/Genuino Uno"
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:10:1: error: 'Locomotive' does not name a type
Locomotive* Locomotives::pFirstLocomotive = NULL;
^~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:11:6: error: 'Locomotives' has not been declared
bool Locomotives::useFunctionRegister = false;
^~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:13:1: error: 'Locomotive' does not name a type
Locomotive* Locomotives::get(uint16_t inAddress)
^~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:29:1: error: 'Locomotive' does not name a type
Locomotive* Locomotives::get(const char* inName)
^~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:45:6: error: 'Locomotives' has not been declared
void Locomotives::remove(uint16_t inAddress)
^~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:49:6: error: 'Locomotives' has not been declared
void Locomotives::remove(const char* inName)
^~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp: In function 'void remove(const char*)':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:49:6: error: ambiguating new declaration of 'void remove(const char*)'
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:24:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,
from C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:7:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:960:12: note: old declaration 'int remove(const char*)'
extern int remove(const char *pathname);
^~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp: At global scope:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:53:5: error: 'Locomotives' has not been declared
int Locomotives::count()
^~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp: In function 'int count()':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:57:2: error: 'Locomotive' was not declared in this scope
Locomotive* pCurr = pFirstLocomotive;
^~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:57:14: error: 'pCurr' was not declared in this scope
Locomotive* pCurr = pFirstLocomotive;
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:57:14: note: suggested alternative: 'perror'
Locomotive* pCurr = pFirstLocomotive;
^~~~~
perror
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotives.cpp:57:22: error: 'pFirstLocomotive' was not declared in this scope
Locomotive* pCurr = pFirstLocomotive;
^~~~~~~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:10:6: error: 'Registers' has not been declared
byte Registers::registers[MAXIMUM_REGISTER_SIZE / 8];
^~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:10:27: error: 'MAXIMUM_REGISTER_SIZE' was not declared in this scope
byte Registers::registers[MAXIMUM_REGISTER_SIZE / 8];
^~~~~~~~~~~~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:10:27: note: suggested alternative: 'MAX_MAIN_REGISTERS'
byte Registers::registers[MAXIMUM_REGISTER_SIZE / 8];
^~~~~~~~~~~~~~~~~~~~~
MAX_MAIN_REGISTERS
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:12:6: error: 'Registers' has not been declared
void Registers::clear()
^~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: In function 'void clear()':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:14:22: error: 'MAXIMUM_REGISTER_SIZE' was not declared in this scope
for (int i = 0; i < MAXIMUM_REGISTER_SIZE / 8; i++)
^~~~~~~~~~~~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:14:22: note: suggested alternative: 'MAX_MAIN_REGISTERS'
for (int i = 0; i < MAXIMUM_REGISTER_SIZE / 8; i++)
^~~~~~~~~~~~~~~~~~~~~
MAX_MAIN_REGISTERS
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:15:3: error: 'registers' was not declared in this scope
registers = 0;
^~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:15:3: note: suggested alternative: 'register'
registers = 0;
^~~~~~~~~
register
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: At global scope:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:18:9: error: 'Registers' has not been declared
uint8_t Registers::allocateRegister()
^~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: In function 'uint8_t allocateRegister()':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:20:22: error: 'MAXIMUM_REGISTER_SIZE' was not declared in this scope
for (int i = 1; i < MAXIMUM_REGISTER_SIZE; i++)
^~~~~~~~~~~~~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:20:22: note: suggested alternative: 'MAX_MAIN_REGISTERS'
for (int i = 1; i < MAXIMUM_REGISTER_SIZE; i++)
^~~~~~~~~~~~~~~~~~~~~
MAX_MAIN_REGISTERS
In file included from C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:7:0:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:22:15: error: 'registers' was not declared in this scope
if (bitRead(registers[i / 8], i % == 0)
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:111:32: note: in definition of macro 'bitRead'
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:22:15: note: suggested alternative: 'register'
if (bitRead(registers[i / 8], i % == 0)
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:111:32: note: in definition of macro 'bitRead'
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: At global scope:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:32:6: error: 'Registers' has not been declared
void Registers::freeRegister(uint8_t inRegister)
^~~~~~~~~
In file included from C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:7:0:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: In function 'void freeRegister(uint8_t)':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:34:11: error: 'registers' was not declared in this scope
bitClear(registers[inRegister / 8], inRegister % ;
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:113:32: note: in definition of macro 'bitClear'
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:34:11: note: suggested alternative: 'register'
bitClear(registers[inRegister / 8], inRegister % ;
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:113:32: note: in definition of macro 'bitClear'
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: At global scope:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:37:6: error: 'Registers' has not been declared
bool Registers::isAllocated(byte inRegister)
^~~~~~~~~
In file included from C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:7:0:
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp: In function 'bool isAllocated(byte)':
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:39:17: error: 'registers' was not declared in this scope
return bitRead(registers[inRegister / 8], inRegister % ;
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:111:32: note: in definition of macro 'bitRead'
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Registers.cpp:39:17: note: suggested alternative: 'register'
return bitRead(registers[inRegister / 8], inRegister % ;
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:111:32: note: in definition of macro 'bitRead'
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
^~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotive.cpp:10:1: error: 'Locomotive' does not name a type
Locomotive::Locomotive(const char* inName, uint8_t inSpeedRegister, uint16_t inAddress, uint8_t inSpeedMax)
^~~~~~~~~~
C:\Users\gbouc\OneDrive\Documents\Arduino\libraries\DCCpp\src\Locomotives\Locomotive.cpp:25:1: error: 'Locomotive' does not name a type
Locomotive::Locomotive(const char* inName, uint8_t inSpeedRegister, uint8_t inFunctionRegister, uint16_t inAddress, uint8_t inSpeedMax)
^~~~~~~~~~
exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno
Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.