chamessmaa
Messages postés1Date d'inscriptionmardi 9 juin 2015StatutMembreDernière intervention 9 juin 2015
-
9 juin 2015 à 18:05
slt , j'ai réalisé une application mais j'ai un petit problème, mon application et de faire un affichage pour la date et l'heure a partir d'un ds1307 et , faire l'affichage de l'humidité et la température a partir d'un DHT11 l'affichage ce fait sure un écran LCD , aussi une carte arduino qui ce fonctionne tout ca , et j'ai des événement qui son affiche au cours de l'année a partir du date comme hiver (du décembre -------> février) mais le problème , lorsque je fait une modification du mois et jour a partir du bouton pour voir les affichage saisonnière elle ne mémorise pas cette modification
aidez moi svp
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h> //* communication série serial print
#include <DS1307RTC.h>
#include <dht.h>
dht DHT; //*
#define DHT11_PIN A0
LiquidCrystal lcd(8, 9, 7, 6, 5, 4);
const int b1 = 13;
const int b2 = 12;
const int b3 = 11;
const int b4 = 10;
tmElements_t tm; //* pointeur fih tm.minute tm.hou....
void setup() {
pinMode(b1, INPUT);
pinMode(b2, INPUT);
pinMode(b3, INPUT);
pinMode(b4, INPUT);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" BIEN VENUE ");
lcd.setCursor(0, 1);
lcd.print(" ISET JENDOUBA ");
delay(5000);
lcd.clear();
}
void loop() {
lcd.clear();
tmElements_t tm; //*
if (RTC.read(tm)) { //* bech ya9ra pointeur mel rtc
lcd.print("/");
print2digits(tmYearToCalendar(tm.Year-30)); //* bech ya9ra el 3am mel calendrier
if ((tm.Month == 1) && (tm.Day > 13))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" Les nuits noires ");
}
if ((tm.Month == 2) && (tm.Day < 3))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" Les nuits noires ");
}
if ((tm.Month == 2) && (tm.Day > 2))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" Loures de froid ");
}
if ((tm.Month == 2) && (tm.Day < 14))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" Loures de froid ");
}
if ((tm.Month == 2) && (tm.Day > 13))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" le grand froid ");
}
if ((tm.Month == 2) && (tm.Day < 19))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print(" Loures de froid ");
}
if ((tm.Month == 2) && (tm.Day > 21))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("rechauffement de l'air ");
}
if ((tm.Month == 2) && (tm.Day < 28))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("rechauffement de l'air ");
}
if ((tm.Month == 2) && (tm.Day > 27))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Debut de primptemps ");
}
if ((tm.Month == 3) && (tm.Day < 6))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Debut fr primptemps");
}
if ((tm.Month == 3) && (tm.Day > 5))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("rechauffement de la terre");
}
if ((tm.Month == 3) && (tm.Day < 10))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("rechauffement de la terre");
}
if ((tm.Month == 3) && (tm.Day > 9))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Jours intercalaires ");
}
if ((tm.Month == 3) && (tm.Day < 18))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Jours intercalaires");
}
if ((tm.Month == 3) && (tm.Day > 17))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Printemps");
}
if ((tm.Month == 3) && (tm.Day < 21))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Printemps ");
}
if ((tm.Month == 3) && (tm.Day == 21))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Equinoxe");
}
if ((tm.Month == 3) && (tm.Day > 21))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Printemps ");
}
if ((tm.Month == 3) && (tm.Day < 29))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Printemps");
}
if ((tm.Month == 4) && (tm.Day > 28))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Debut ETE");
}
if ((tm.Month == 4) && (tm.Day < 19))
{
lcd.clear();
lcd.setCursor(0, 0);
// print the number of seconds since reset:
lcd.print("Debut l'été");
}
if ((tm.Month == 6) && (tm.Day == 9)&& (tm.Second==30))
{
lcd.clear();
lcd.setCursor(2, 0);
// print the number of seconds since reset:
lcd.print("Debut ETE");
lcd.setCursor(4, 1);
// print the number of seconds since reset:
lcd.print("Debut ETE");
delay(15000);
}
} else {
if (RTC.chipPresent()) { //* enregistre wa9et hors connexion
Serial.println("The DS1307 is stopped. Please run the SetTime");
Serial.println("example to initialize the time and begin running.");
Serial.println();
} else {
Serial.println("DS1307 read error! Please check the circuitry.");
Serial.println();
}
delay(9000);
}
delay(1000);
}
void print2digits(int number) { //*