i am new to this please help me digital programmable 7 day weekly timer need to mod menu & alarm i want to be able to set in the menu alarm on and off time it needs to run like this ( monday thru thursday turn on 4:30 pm turn off 2 am) (now friday turn on 4:30pm stay on all weekend turn off monday 2 am
i am using this code i found with 4 X 20 lcd i have it
the relay is on pin 12 it goes high to turn on
i have it working just need to mod the alarm
Phi clock version 5
there are parts to this code in the files down below i dont no how to post it all at one time here in text form
this is were i got the code i have it working with a arduino uno and rtc
i think i have to edit here
void top_menu_function_3() //Set alarms
{
int temp1, ala=0;
char msg[17];
int user_input;
phi_prompt_struct myIntegerInput, myListInput; // This structure stores the main menu.
lcd.clear();
sprintf(msg,"Alarm %02d:",0);
lcd.print(msg);
user_input=0; // Current value
myIntegerInput.ptr.i_buffer=&user_input; // Pass the address of the buffer
myIntegerInput.low.i=0; // Lower limit
myIntegerInput.high.i=Max_alarms-1; // Upper limit
myIntegerInput.step.i=1; // Step size
myIntegerInput.col=7; // Display prompt at column 7
myIntegerInput.row=1; // Display prompt at row 1
myIntegerInput.width=2; // The number occupies 2 characters space
myIntegerInput.option=1; // Option 0, space pad right, option 1, zero pad left, option 2, space pad left.
lcd.clear();
center_text("Which alarm?"); // Prompt user for input
if (input_integer(&myIntegerInput)!=-1) ala=user_input; // If the user didn't press escape (return -1) then update the ultimate storage with the value in the buffer.
else return;
user_input=clock1.alarms[ala].hr; // Current value
myIntegerInput.high.i=23; // Upper limit
lcd.clear();
center_text("Hour"); // Prompt user for input
if (input_integer(&myIntegerInput)!=-1) clock1.alarms[ala].hr=user_input; // If the user didn't press escape (return -1) then update the ultimate storage with the value in the buffer.
else return;
user_input=clock1.alarms[ala].mnt; // Current value
myIntegerInput.high.i=59; // Upper limit
lcd.clear();
center_text("Minute"); // Prompt user for input
if (input_integer(&myIntegerInput)!=-1) clock1.alarms[ala].mnt=user_input; // If the user didn't press escape (return -1) then update the ultimate storage with the value in the buffer.
else return;
myListInput.ptr.list=(char**)&alarm_items; // Assign the list to the pointer
myListInput.low.i=clock1.alarms[ala].dow; // Default item highlighted on the list
myListInput.high.i=4; // Last item of the list is size of the list - 1.
myListInput.width=7; // Length in characters of the longest list item.
myListInput.col=0; // Display prompt at column 0
myListInput.row=1; // Display prompt at row 1
myListInput.option=1; // Option 0, display classic list, option 1, display 2X2 list, option 2, display list with index, option 3, display list with index2.
myListInput.step.c_arr[0]=lcd_rows-1; // rows to auto fit entire screen
myListInput.step.c_arr[1]=lcd_columns/8; // multi col list
lcd.clear();
center_text("Type"); // Prompt user for input
if (select_list(&myListInput)!=-1) clock1.alarms[ala].dow=myListInput.low.i; // select_list stores user choice in myListInput.low. If the user didn't press escape (return -1) then update the user choice with the value in myListInput.low.
else return;
clock1.save_alarm(ala); ///< Save the setting of this particular alarm to EEPROM.
}
or here
void alarm_clock::alarm()
{
int temp1;
for (int i=0;i<4;i++)
{
tone(buzzer,770);
temp1=wait_on_escape(75);
if ((temp1==5)||(temp1==6))
{
noTone(buzzer);
alarm_is_on=false; // Turn off alarm
return;
}
noTone(buzzer);
temp1=wait_on_escape(75);
if ((temp1==5)||(temp1==6))
{
noTone(buzzer);
alarm_is_on=false; // Turn off alarm
return;
}
}
temp1=wait_on_escape(150);
if ((temp1==5)||(temp1==6))
{
noTone(buzzer);
alarm_is_on=false; // Turn off alarm
return;
}
}
Phi_2_project_alarm_clock_v6.ino (9.2 KB)
Example_menu.ino (12.2 KB)
alarm_clock.ino (5.04 KB)