You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
In some cases with functions, I have a problem because the functions will refer to an object before the object declaration.
Here is an example of the generated code: The function "AfficheHeure" will use the object lcd before its declaration, this will lead to compiler error within tthe Arduino IDE.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int Heure;
int Minute;
int Seconde;
int Jour;
int Mois;
int Annee;
unsigned long MemSeconde;
// Décrire cette fonction
void AfficheHeure() {
if (Heure < 10) {
lcd.setCursor(3,0);
lcd.print("0");
lcd.setCursor(4,0);
lcd.print(Heure);
Hi
In some cases with functions, I have a problem because the functions will refer to an object before the object declaration.
Here is an example of the generated code: The function "AfficheHeure" will use the object lcd before its declaration, this will lead to compiler error within tthe Arduino IDE.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int Heure;
int Minute;
int Seconde;
int Jour;
int Mois;
int Annee;
unsigned long MemSeconde;
// Décrire cette fonction
void AfficheHeure() {
if (Heure < 10) {
lcd.setCursor(3,0);
lcd.print("0");
lcd.setCursor(4,0);
lcd.print(Heure);
} else {
lcd.setCursor(3,0);
lcd.print(Heure);
}
lcd.setCursor(5,0);
lcd.print(":");
if (Minute < 10) {
lcd.setCursor(6,0);
lcd.print("0");
lcd.setCursor(7,0);
lcd.print(Minute);
} else {
lcd.setCursor(6,0);
lcd.print(Minute);
}
lcd.setCursor(8,0);
lcd.print(":");
if (Seconde < 10) {
lcd.setCursor(9,0);
lcd.print("0");
lcd.setCursor(10,0);
lcd.print(Seconde);
} else {
lcd.setCursor(9,0);
lcd.print(Seconde);
}
if (Jour < 10) {
lcd.setCursor(2,1);
lcd.print("0");
lcd.setCursor(3,1);
lcd.print(Jour);
} else {
lcd.setCursor(2,1);
lcd.print(Jour);
}
lcd.setCursor(4,1);
lcd.print("/");
if (Mois < 10) {
lcd.setCursor(5,1);
lcd.print("0");
lcd.setCursor(6,1);
lcd.print(Mois);
} else {
lcd.setCursor(5,1);
lcd.print(Mois);
}
lcd.setCursor(7,1);
lcd.print("/");
lcd.setCursor(8,1);
lcd.print(Annee);
}
LiquidCrystal_I2C lcd(0x3F, 16, 2);
// Décrire cette fonction
void MiseAJourHeure() {_
The text was updated successfully, but these errors were encountered: