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.
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 ....
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.
@@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?
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. 😉
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.
@@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+
@@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.
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.
@@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/
@@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 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.
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.
@@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.
@@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.
@@faowff034faerf3490ur Muchas gracias! resolvio el problema! Pero ahora tengo otro problema. :-(. "'int LiquidCrystal_I2C::init()' is private within this context " Muchas gracias de nuevo!!
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
Buen dia! ya funciona el compilador. Muchas gracias por la ayuda!! Deberías hacer mas proyectos con Arduino, tu eres un genio! :-)
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
@@teamcam1896 hola, como estas. Básicamente instale la versión que está en el enlace de la respuesta de abajo...
Hola, pudiste resolver el problema?
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.
brother you are doing a great work but plz provide the information in the video you will get milllions of subscriber
Hello friend, do you have a recent version of this code? Thanks
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
....
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.
@@faowff034faerf3490ur Would you mind if I ask you about your code?
@@AnthraxThy01 Yes, as long as I can answer you with my weak explanation.
@@AnthraxThy01 My bad. I mean Sure, not Yes. I gave you the wrong answer.
@@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?
Hi Bro... After disconnected from the power source can the RTC still keep the time set or it will reset automatically?
Thank U Bro❤
It works fine with the battery on the RTC module side.
Hi, I have one error " no matching function for call to 'DS3231::DS3231()' I use DS3231-Master How I can fix it ?
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. 😉
@@faowff034faerf3490ur I selected DS3231 version 1.0.5 and the error is :'D3231 clock' redeclared as different kind of symbol
I found a good library .I like how it works, it's a shame it doesn't have an alarm
Hi friend! Is it final already? Thank you
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.
@@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+
@@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.
Now I'm finished it. unnecessary code has been removed.
@@faowff034faerf3490ur Thank you very much; Is the Display connection to the Arduino standard?
Have you tried it with the ESP8266?
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.
@@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/
@@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.
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.
@@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.
Buen día, mi librería DS3231.h no reconoce algunos comandos...
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.
@@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.
@@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.
@@faowff034faerf3490ur Muchas gracias! resolvio el problema! Pero ahora tengo otro problema. :-(.
"'int LiquidCrystal_I2C::init()' is private within this context
" Muchas gracias de nuevo!!
Use la libreria github.com/johnrickman/LiquidCrystal_I2C pero no resuelve el problema..
the code please
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.
@@faowff034faerf3490ur when you fix it you will put the code in the discribtion ??
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