arduino real time clock with rotary encoder

Sdílet
Vložit
  • čas přidán 2. 02. 2018
  • More detailed video • Arduino rotary encoder...
    sketch : create.arduino.cc/editor/tare...
    github : github.com/faowff034faerf3490...

Komentáře • 48

  • @eduardoalvarez8540
    @eduardoalvarez8540 Před 3 lety

    Buen dia! ya funciona el compilador. Muchas gracias por la ayuda!! Deberías hacer mas proyectos con Arduino, tu eres un genio! :-)

    • @teamcam1896
      @teamcam1896 Před rokem

      Hola Eduardo, me puedes explicar cómo resolviste el problema, ya instalé la versión DS3231 1.0.5 pero persiste la alarma. Gracias por el feedback

    • @eduardoalvarez8540
      @eduardoalvarez8540 Před rokem

      @@teamcam1896 hola, como estas. Básicamente instale la versión que está en el enlace de la respuesta de abajo...

    • @eduardoalvarez8540
      @eduardoalvarez8540 Před 3 měsíci

      Hola, pudiste resolver el problema?

  • @faowff034faerf3490ur
    @faowff034faerf3490ur  Před 5 lety

    I fixed some codes in response to Mr.Daniel's resonable request.
    Since I update it from time to time, if you have the old code, please make sure it is the latest version.

  • @najeeullah97
    @najeeullah97 Před rokem

    brother you are doing a great work but plz provide the information in the video you will get milllions of subscriber

  • @Dancopymus
    @Dancopymus Před rokem

    Hello friend, do you have a recent version of this code? Thanks

  • @AnthraxThy01
    @AnthraxThy01 Před 3 lety +1

    Hi, your code is very clean and nice. As a newbie I'm trying to convert this one into a OLED version (Library: "Adafruit_SSD1306.h" + "U8g2_for_Adafruit_GFX.h" [ to have more font style]) with the encoder switch based on "Onebutton.h"[ to have more function] but it seems no luck for me. The first problem is that when I try to comply your conde it said 'PIND' was not declared in this scope
    ....

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      Thank you for your encouraging comments.
      My programming style is based on an analysis of Konami games such as Nemesis (Gradius) and Twinbee.
      They were an elegant program to run on older PCs called MSX.
      I hope some of my code helps your programming.

    • @AnthraxThy01
      @AnthraxThy01 Před 3 lety

      @@faowff034faerf3490ur Would you mind if I ask you about your code?

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      @@AnthraxThy01 Yes, as long as I can answer you with my weak explanation.

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      ​@@AnthraxThy01 My bad. I mean Sure, not Yes. I gave you the wrong answer.

    • @AnthraxThy01
      @AnthraxThy01 Před 3 lety

      @@faowff034faerf3490ur When I try to comply your code to my arduino nano every, in the 2_encoder, isr_0 you got a "REGS1 = PIND & 0b00001100;" it said that PIND is not def... I think I had lot more to learn from you, would you mind we discuss in email?

  • @rajkumarshanmugam4114
    @rajkumarshanmugam4114 Před 4 lety +1

    Hi Bro... After disconnected from the power source can the RTC still keep the time set or it will reset automatically?
    Thank U Bro❤

  • @bogdan546
    @bogdan546 Před 2 lety

    Hi, I have one error " no matching function for call to 'DS3231::DS3231()' I use DS3231-Master How I can fix it ?

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 2 lety

      Thank you for watching.
      Maybe the DS3231 library you are using is version 1.0.6 or 1.0.7.
      So use the IDE's Library Manager to select DS3231 version 1.0.5. Maybe that will eliminate the error.
      If you want to use the latest version of the DS3231 library, feel free to rewrite the code. 😉

    • @bogdan546
      @bogdan546 Před 2 lety

      @@faowff034faerf3490ur I selected DS3231 version 1.0.5 and the error is :'D3231 clock' redeclared as different kind of symbol

    • @bogdan546
      @bogdan546 Před 2 lety

      I found a good library .I like how it works, it's a shame it doesn't have an alarm

  • @Dancopymus
    @Dancopymus Před 5 lety +1

    Hi friend! Is it final already? Thank you

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 5 lety

      Thank you for your kind attention. XD
      I'm going to do it within the year as soon as possible.
      Now I'm adding an alarm function. I'll report to you when this task is over.

    • @Dancopymus
      @Dancopymus Před 5 lety +1

      @@faowff034faerf3490ur Ok, but without the alarm function, the code is working perfect? I would not use the alarm, because, this is good for me; (meuviolino@hotmail.com) Thank you+

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 5 lety

      ​@@Dancopymus I see. here you are. create.arduino.cc/editor/tarekichi/b1c1571c-bee4-472c-9cbf-80c460ef2f37/preview
      There are unnecessary codes left in it, but it should work normally. Later, I reduce those extra codes.
      Adding wake up alarm is due to technical interest in programming. Actually I do not use it.

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 5 lety

      Now I'm finished it. unnecessary code has been removed.

    • @Dancopymus
      @Dancopymus Před 5 lety

      @@faowff034faerf3490ur Thank you very much; Is the Display connection to the Arduino standard?

  • @puzzle74
    @puzzle74 Před 3 lety +1

    Have you tried it with the ESP8266?

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      Yes i have I bought an ESP8266 about 2 years ago.
      I think it's great that can use the NTP service via WiFi.
      But I haven't tried it yet. This is due to my lack of knowledge and experience with ESP8266.

    • @puzzle74
      @puzzle74 Před 3 lety

      @@faowff034faerf3490ur
      I've tried it, but there are some compilation errors. As an example the DS3231 clock 'redeclared as different kind of symbol error.
      #include
      DS3231 clock; RTClib rtc; Typing Clock with a capital letter resolves this problem.
      Clock.getYear ()
      Clock.getMonth (Century);
      Clock.getDate ();
      Clock.getHour (h12, PM);
      Clock.getMinute ();
      Clock.getSecond ();
      as .
      However, problems persist. The biggest problem is in the interupt part.
      Error "TCCR1A 'was not declared in this scope"
      void piezo_alarm (void) (
      TCCR1A = 0b00100001; //*****************error*****************
      TCCR1B = 0b00010010; //*****************error*****************
      OCR1A = (uint16_t) (1000000 / frequency);
      OCR1B = (uint16_t) (1000000 / frequency * duty);
      }
      PIND 'was not declared in this scope
      ************************************************
      void isr_0 (void) (
      REGS1 = PIND & 0b00001100; // *****************error ********
      if ((REGS1 == 0b00001100) && CLK_PIN) (
      RotaryCounter--; ReleaseCounter = 0;
      Rotation = ON; CLK_PIN = DT_PIN = LOW; sei ();
      } else if (REGS1 == _BV (2)) DT_PIN = HIGH;
      }
      void isr_1 (void) (
      REGS2 = PIND & 0b00001100;
      if ((REGS2 == 0b00001100) && DT_PIN) (
      RotaryCounter ++; ReleaseCounter = 0;
      Rotation = ON; CLK_PIN = DT_PIN = LOW; sei ();
      } else if (REGS2 == _BV (3)) CLK_PIN = HIGH;
      }
      ESP8266 is very easy to use, this link will help you.
      randomnerdtutorials.com/projects-esp8266/
      First of all, start by uploading the board to the Arduino.
      randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      @@puzzle74 TCCR1A and TCCR1B are reserved words prepared to access the register for hardware interrupt processing.
      PIND is also a reserved word for directly manipulating port D on Arduino.
      If you are using an IDE for Arduino and still get a compile error, there is a problem with IDE or library settings.
      If the AVR chip set is different, please rewrite the code as your wish.
      Thank you for giving me a pair of useful URLs.

    • @puzzle74
      @puzzle74 Před 3 lety

      I finally managed to run the codes with ESP8266. If you send me your e-mail address, I can send you compiled files for the Esp8266.

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety +1

      ​@@puzzle74 Congratulations. I'm glad it went well.
      I think your code will be useful to someone who is more interested in ESP8266 than I am.
      I recommend you to share it on your blog, GitHub, etc. for everyone.
      If you difficult to do that, please give me a brief overview of what caused the symbol error and how you resolved it.

  • @eduardoalvarez8540
    @eduardoalvarez8540 Před 3 lety +1

    Buen día, mi librería DS3231.h no reconoce algunos comandos...

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety +1

      Hola Sr.Eduardo. Cuénteme un poco más concretamente sobre la versión de la librería DS3231.h que está utilizando, los comandos que no funcionaron, etc.

    • @eduardoalvarez8540
      @eduardoalvarez8540 Před 3 lety

      @@faowff034faerf3490ur Muchas gracias por responderme tan rapido! La libreria que uso es la "Arduino-DS3231-master", cuando voy a compilar sale un error "'RTClib' does not name a type
      ". Muchas gracias de nuevo por la ayuda. Me quede sorprendido de lo bien que hace sus codigos.

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 3 lety

      ​@@eduardoalvarez8540 Estoy usando la libreria DS3231 de "Northern Widget LLC". Para evitar errores de compilación sin volver a escribir el código fuente, debe descargar github.com/NorthernWidget/DS3231 e importarlo al IDE.
      ¿Esto resolverá el problema? I wish you the best. te deseo lo mejor.

    • @eduardoalvarez8540
      @eduardoalvarez8540 Před 3 lety

      @@faowff034faerf3490ur Muchas gracias! resolvio el problema! Pero ahora tengo otro problema. :-(.
      "'int LiquidCrystal_I2C::init()' is private within this context
      " Muchas gracias de nuevo!!

    • @eduardoalvarez8540
      @eduardoalvarez8540 Před 3 lety

      Use la libreria github.com/johnrickman/LiquidCrystal_I2C pero no resuelve el problema..

  • @mahmoudrashad3079
    @mahmoudrashad3079 Před 5 lety +1

    the code please

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 5 lety

      here you are.
      However, this code has some problems due to RTC library selection.
      I would like to fix it as quickly as I can.

    • @mahmoudrashad3079
      @mahmoudrashad3079 Před 5 lety +1

      @@faowff034faerf3490ur when you fix it you will put the code in the discribtion ??

    • @faowff034faerf3490ur
      @faowff034faerf3490ur  Před 5 lety +1

      Mahmoud Rashad I rewrote the code on December 22, 2018.
      I think that you can understand without explaining.
      create.arduino.cc/editor/tarekichi/b1c1571c-bee4-472c-9cbf-80c460ef2f37/preview