But I want to make the alarm beep every hour on the hour for 5 seconds. For example 1:00,2:00,3:00 etc hits and bam piezo goes off for 5 seconds then turns offI'm using arduinos sample code for its GPS clock project. I just need to add the alarm code/Alarm hardware to the circuit

Wiring is the same as the sample

https://learn.adafruit.com/arduino-clock/hardware

Can you guys tell me how to do this?

I'll be using a piezo buzzer

// Clock example using a seven segment display & GPS for time.//// Must have the Adafruit GPS library installed too! See:// https://github.com/adafruit/Adafruit-GPS-Library//// Designed specifically to work with the Adafruit LED 7-Segment backpacks// and ultimate GPS breakout/shield:// ----> http://www.adafruit.com/products/881// ----> http://www.adafruit.com/products/880// ----> http://www.adafruit.com/products/879// ----> http://www.adafruit.com/products/878// ----> http://www.adafruit.com/products/746//// Adafruit invests time and resources providing this open source code, // please support Adafruit and open-source hardware by purchasing // products from Adafruit!//// Written by Tony DiCola for Adafruit Industries.// Released under a MIT license: https://opensource.org/licenses/MIT

// Set to false to display time in 12 hour format, or true to use 24 hour:#define TIME_24_HOUR false

// Offset the hours from UTC (universal time) to your local time by changing// this value. The GPS time will be in UTC so lookup the offset for your// local time from a site like:// https://en.wikipedia.org/wiki/List_of_UTC_time_offsets// This value, -7, will set the time to UTC-7 or Pacific Standard Time during// daylight savings time.#define HOUR_OFFSET -4

// I2C address of the display. Stick with the default address of 0x70// unless you've changed the address jumpers on the back of the display.#define DISPLAY_ADDRESS 0x70

// Use a 1 hz, once a second, update rate. gps.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);

// Enable the interrupt to parse GPS data. enableGPSInterrupt();}

void loop() { // Loop function runs over and over again to implement the clock logic.

// Check if GPS has new data and parse it. if (gps.newNMEAreceived()) { gps.parse(gps.lastNMEA()); }

// Grab the current hours, minutes, seconds from the GPS. // This will only be set once the GPS has a fix! Make sure to add // a coin cell battery so the GPS will save the time between power-up/down. int hours = gps.hour + HOUR_OFFSET; // Add hour offset to convert from UTC // to local time. // Handle when UTC + offset wraps around to a negative or > 23 value. if (hours < 0) { hours = 24+hours; } if (hours > 23) { hours = 24-hours; } int minutes = gps.minute; int seconds = gps.seconds;

// Show the time on the display by turning it into a numeric // value, like 3:30 turns into 330, by multiplying the hour by // 100 and then adding the minutes. int displayValue = hours*100 + minutes;

// Now print the time value to the display. clockDisplay.print(displayValue, DEC);

// Add zero padding when in 24 hour mode and it's midnight. // In this case the print function above won't have leading 0's // which can look confusing. Go in and explicitly add these zeros. if (TIME_24_HOUR && hours == 0) { // Pad hour 0. clockDisplay.writeDigitNum(1, 0); // Also pad when the 10's minute is 0 and should be padded. if (minutes < 10) { clockDisplay.writeDigitNum(2, 0); } }

// Blink the colon by turning it on every even second and off // every odd second. The modulus operator is very handy here to // check if a value is even (modulus 2 equals 0) or odd (modulus 2 // equals 1). clockDisplay.drawColon(seconds % 2 == 0);

// Now push out to the display the new values that were set above. clockDisplay.writeDisplay();

// Loop code is finished, it will jump back to the start of the loop // function again! Don't add any delays because the parsing needs to // happen all the time!}

SIGNAL(TIMER0_COMPA_vect) { // Use a timer interrupt once a millisecond to check for new GPS data. // This piggybacks on Arduino's internal clock timer for the millis() // function. gps.read();}

like thiswhen posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The "Code: [Select]" feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing.If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Unless the sketch is too large, it's better if you post your code, rather than attach it. When it's attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the "Temp" folder and manually remove it. It's much easier to just view the code in your post.

Many questions can be answered by reading the documentation which is provided with the IDE, available under the help tab, or online here.

... with a transistor and a large sum of money to spend ...Please don't PM me with technical questions. Post them in the forum.