| Ligne 111 : |
Ligne 111 : |
| | pinMode( PIEZO_BUZZER, OUTPUT ); | | pinMode( PIEZO_BUZZER, OUTPUT ); |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − | * Démarrer la connection I2C avec l'afficheur en lui insérant une adresse (0x70 par défaut) | + | * Démarrer la connection I2C avec l'afficheur en lui insérant une adresse (0x70 par défaut). |
| | <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| | // Adresse I2C des afficheurs | | // Adresse I2C des afficheurs |
| Ligne 131 : |
Ligne 131 : |
| | } | | } |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − | * Formattage de l'EEPROM si rien dedans (vérification si fanion égale à 255) et si la version est égale à ce qu'il y a dans l'EEPROM | + | * Formattage de l'EEPROM si rien dedans (vérification si fanion égale à 255) et si la version est égale à ce qu'il y a dans l'EEPROM. |
| | <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| | if( EEPROM.read(0) != 255 || EEPROM.read(1) != VERSION ) | | if( EEPROM.read(0) != 255 || EEPROM.read(1) != VERSION ) |
| | eepromConfiguration(); | | eepromConfiguration(); |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − | * Définir la luminosité par rapport à la luminosité enregistré dans l'EEPROM | + | * Définir la luminosité par rapport à la luminosité enregistré dans l'EEPROM. |
| | <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| | // Définir la luminosité des afficheurs | | // Définir la luminosité des afficheurs |
| | afficheurs.setBrightness( EEPROM.read(2) ); | | afficheurs.setBrightness( EEPROM.read(2) ); |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − | * Copier les alarmes enregistré dans l'EEPROM dans la structure du programme | + | * Copier les alarmes enregistré dans l'EEPROM dans la structure du programme. |
| | <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| − | // Configuration des dates/heures sur les alarmes
| + | // Configuration des dates/heures sur les alarmes |
| − | DateTime maintenant = rtc.now();
| + | DateTime maintenant = rtc.now(); |
| − | int j = 0;
| + | int j = 0; |
| − | for( int i=3 ; i< ( NBRALARMES*2 )+6 ; i+=3 ){
| + | for( int i=3 ; i< ( NBRALARMES*2 )+6 ; i+=3 ){ |
| − | alarme[j].heureSonne = DateTime( maintenant.year(), maintenant.month(), maintenant.day(), EEPROM.read(i), EEPROM.read(i+1), 0);
| + | alarme[j].heureSonne = DateTime( maintenant.year(), maintenant.month(), maintenant.day(), EEPROM.read(i), EEPROM.read(i+1), 0); |
| − | alarme[j].programme = EEPROM.read(i+2);
| + | alarme[j].programme = EEPROM.read(i+2); |
| − | j++;
| + | j++; |
| − | }
| |
| | } | | } |
| | </syntaxhighlight> | | </syntaxhighlight> |