Partage
  • Partager sur Facebook
  • Partager sur Twitter

signal radio DCF77

problème logiciel avecarduino

    16 novembre 2017 à 18:49:17

    Bonjour,

    Problème de lecture du signal radio provenant d'une carte DCF77 + antenne, avec Arduino Uno (1.8.4).

    Câblage du module sortie DCF sur Pin 2 (interruption 0) avec une résistance Pullup de 10k.

    Au niveau hardware tout semble correct; je vois le signal à l'oscillo, le programme de test DCF Signal contenu dans les exemples fonctionne bien!

    Le programme Internal Clock Sync fourni dans les exemples ne fonctionne pas correctement.

    J'ai abord une erreur lors de la compilation : "time_t time"   redeclared as different kind of symbol.

    En modifiant la ligne #include "Time.h" par #include "TimeLib.h" l'erreur de compilation disparait; mais le programme lancé le message

    "Time is updated" n'est jamais affiché et la date reste fixée au 1 janvier 1970

    La librairie DC77 (1.0.0) est celle de Thym Elenbaas.

    La librairie Time est celle inclue avec Arduino.

    La librairie TimeLib je ne la retrouve pas dans la liste des librairies !

    Programme:

    * InternalClockSync.pde

     * example code illustrating time synced from a DCF77 receiver

     * Thijs Elenbaas, 2012

     * This example code is in the public domain.

      This example shows how to fetch a DCF77 time and synchronize

      the internal clock. In order for this example to give clear output,

      make sure that you disable logging  from the DCF library. You can 

      do this by commenting out   #define VERBOSE_DEBUG 1   in Utils.cpp. 

      NOTE: If you used a package manager to download the DCF77 library, 

      make sure have also fetched these libraries:

     * Time 

     A package that includes all referenced libraries can be found at:

     https://github.com/thijse/Zipballs/blob/master/DCF77/DCF77.zip?raw=true  

     */

    #include "DCF77.h"

    #include "Time.h"

    #define DCF_PIN 2        // Connection pin to DCF 77 device

    #define DCF_INTERRUPT 0// Interrupt number associated with pin

    time_t time;

    DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);

    void setup() {

      Serial.begin(9600); 

      DCF.Start();

      Serial.println("Waiting for DCF77 time ... ");

      Serial.println("It will take at least 2 minutes until a first update can be processed.");

    }

    void loop() {

      delay(1000);

      time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available

      if (DCFtime!=0)

      {

        Serial.println("Time is updated");

        setTime(DCFtime);

      }

      digitalClockDisplay();  

    }

    void digitalClockDisplay(){

      // digital clock display of the time

      Serial.print(hour());

      printDigits(minute());

      printDigits(second());

      Serial.print(" ");

      Serial.print(day());

      Serial.print(" ");

      Serial.print(month());

      Serial.print(" ");

      Serial.print(year()); 

      Serial.println(); 

    }

    void printDigits(int digits){

      // utility function for digital clock display: prints preceding colon and leading 0

      Serial.print(":");

      if(digits < 10)

        Serial.print('0');

      Serial.print(digits);

    }

    Pourriez-vous me donner quelques conseils pour résoudre ce problème.

    Merci d'avance.

    Rodolphe.

    • Partager sur Facebook
    • Partager sur Twitter

    signal radio DCF77

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown