bonjour a tous, j'ai du faire une pose ( beaucoup de taf !!)je reprend un peut mon projet ,j'ai toujours pas trouver la solution, il manque toujours ce fichier (ctags_target_for_gcc_minus_e.cpp) dans le dossier preproc !!, je ne comprend pas pourquoi !! >:( >:(
que donne la manip proposée par hbachetti ?
bonjour, cela n'a rien changer, j'ai fait une réparation windows, et la miracle je n'ai plus la même erreur, maintenant, alors que mon code fonctionner avant, cela me met :
In file included from sketch\NexHardware.h:18:0,
from sketch\NexHardware.cpp:15:
sketch\NexHardware.cpp: In function 'bool recvRetNumber(uint32_t*, uint32_t)':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:55:5: note: in expansion of macro 'nexSerial'
nexSerial.setTimeout(timeout);
^
sketch\NexHardware.cpp:67:31: warning: left shift count >= width of type [-Wshift-count-overflow]
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
^
sketch\NexHardware.cpp:67:49: warning: left shift count >= width of type [-Wshift-count-overflow]
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
^
In file included from sketch\NexHardware.h:18:0,
from sketch\NexHardware.cpp:15:
sketch\NexHardware.cpp: In function 'uint16_t recvRetString(char*, uint16_t, uint32_t)':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:114:16: note: in expansion of macro 'nexSerial'
while (nexSerial.available())
^
sketch\NexHardware.cpp: In function 'void sendCommand(const char*)':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:166:12: note: in expansion of macro 'nexSerial'
while (nexSerial.available())
^
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:171:5: note: in expansion of macro 'nexSerial'
nexSerial.print(cmd);
^
sketch\NexHardware.cpp: In function 'bool recvRetCommandFinished(uint32_t)':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:192:5: note: in expansion of macro 'nexSerial'
nexSerial.setTimeout(timeout);
^
sketch\NexHardware.cpp: In function 'bool nexInit()':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:226:5: note: in expansion of macro 'nexSerial'
nexSerial.begin(9600);
^
sketch\NexHardware.cpp: In function 'void nexLoop(NexTouch**)':
NexConfig.h:37: error: 'Serial2' was not declared in this scope
#define nexSerial Serial2
^
sketch\NexHardware.cpp:242:12: note: in expansion of macro 'nexSerial'
while (nexSerial.available() > 0)
^
exit status 1
'Serial2' was not declared in this scope
quand on est pas un pro c'est pas facile !!!!
Là, on est plus dans le connu. Avec cette instruction
#define nexSerial Serial2
tu demandes au compilateur chaque fois qu'il voit nexSerial de le remplacer par Serial2. Ainsi
while (nexSerial.available())
deviendra
while (Serial2.available())
mais si Serial2 n'est défini nulle part, ça ne compilera pas. Comme la Uno, la Duemilanove dispose d'un seul port série. Tu dois donc en définir un second, par exemple via softwareSerial
Pour ça :
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
l'erreur vient du petit bonhomme à lunettes
--> Pense à mettre ton code entre balises CODE, sinon ça donne ce genre de choses...
Plus sérieusement, le problème doit venir du type des variables utilisées qui ne supporte pas le décalage de 24.
merci pour ta réponse, ce que je ne comprend pas, c'est que avant mon premier problème ( début du post ), mon programme fonctionner très bien !!, pas de problème de serial2 ou quoi que ce soit !!, mais bon ça ne serait pas marrant
![]()
En effet c'est étonnant, mais rien de magique en ce bas monde, tu dois bien avoir modifié quelque chose entre temps.
Poste ton code qui besoin.
Normalement, l'usage de Serial2 ne passe la compilation que lorsqu'on choisit une carte avec plusieurs ports série matériels comme la mega2560
surtout ne pas rire
![]()
le code est trop long,je l'ai joint en attachement
TemperatureDHTHorlogeVoltmetreVentilloalarme11.ino (29.9 KB)
le problème est bizarre, au fur et a mesure de mes modifications de programme et du bon fonctionnement, j'ai fait des sauvegardes en les numérotant, c'est pourquoi mon code a le numéro 11,or la même en reprenant le numéro 1, j'ai la même erreur :
'Serial2' was not declared in this scope
je comprend plus rien >:( >:( >:(
Pas grave... Ce code fonctionne ou pas, du coup ?
avant oui, maintenant non
question peut-être bête, mais : Tu utilises quel modele de carte ?
Et qu'est ce qui ne marche pas ? Plus précisément, que veux tu obtenir et que se passe t-il de different?