![]() #define speaker //Uncomment if speaker is connected to pin 10 through 1 microfarad capacitor and 100 ohm resistor in series (1480 Hz at 5 Hz output) Use the resistor for low-impedance (< 150 ohm) speakers. ![]() Piezo speakers may be connected directly to Pin 10. The capacitor blocks DC voltage from the speaker to preserve the magnet in the speaker from damage. Pin 10 should be connected to the + terminal of the speaker through a 0.5 to 1.0 microfarad capacitor and possibly a 150 ohm resistor. The second option supplies an intermittent (5 Hz) 1580 Hz tone on pin 10 when the alarm is triggered. #define beeper //Uncomment if 5 volt continuous tone beeper or buzzer is connected to pin 10 (5 Hz output) The first option is the default and supplies an intermittent (5 Hz) voltage on pin 10 when the alarm is triggered. The behavior of the alarm output at Pin 10 of the Arduino can be selected by uncommenting ONE of the following lines at the beginning of the code: Uncomment this line at the beginning of the program to enable this feature. There is an optional feature to dim the display between 10 PM and 5 AM. Previously, an asterisk flashed within the analog clock. When the alarm sounds, the entire display now flashes in inverse/normal video at 5 Hz until the alarm is silenced. I moved the alarm enable/disable indicator from the analog clock to between the time and temperature. If the clock is left in setting mode, it will return to the normal display after 30 seconds without a button press. Previously, the alarm was always enabled after a power failure. The status of alarm enable/disable is now stored in EEPROM and will survive a power failure. I fixed a bug that would cause the alarm to timeout after less than the full 60 seconds if the previous alarm was silenced with a button press. ![]() I tested the code with all board types in the IDE and received no compilation errors. I also compile the "note" function only if the "speaker" output is selected, saving memory if any other output option is selected. In v1.3, I added a non-ATmega32U4 version of the "note" function and added conditional compilation directives to automatically compile the correct version. The function I included uses the timer structures for ATmega32U4. I had added a compact "note" function to generate a frequency on Pin 10 if the "speaker" alarm output option was selected. I fixed a problem with the v1.2 code that would cause compilation errors for any non-ATmega32U4 Arduino. It uses the Adafruit graphics libraries and DS3231 library, included in the distribution.Ĭode for both, including needed libraries, may be downloaded directly from the link below in Step 4. Two versions are shown - the basic digital/analog clock and a version with "Pusheen" graphics and animation. ![]() It features a menu system for setting the RTC (no serial port or USB required) This is an OLED alarm clock I built using an Arduino Micro, a tiny OLED 128圆4 display using the SSD1306 controller and I2C interface, and a precision DS3231-based real-time clock module with rechargeable battery backup. UPDATE: V1.3 of clock packages uploaded with bug fix and enhancements. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |