I have beginner skills on arduino, and I kind of jumped the gun into a project for school, to build a programmable switch timer, it has 4 buttons The switch is to be able to program on and off times of a bulb, it should be able to set 2 programs daily for each day of the week(i.e. i can manually program 2 on/off times for each day Monday through sunday).This also implies that date, time are variables that can be programmed. It should also display the room temperature. I WANT IT TO PERFORM CERTAIN FUNCTIONS USING 4 PUSHBUTTONS,
-
Button 1 (Manual Control): This button will allow manual control over the relay module, overriding the programmed settings.
When Button 1 is pressed, it should toggle the state of the relay module (ON if it's currently OFF, and OFF if it's currently ON). This button can be used for manual control regardless of the programmed settings. -
Button 2 (Set Button): This button will be used to set the ON and OFF times for a specific day of the week.
When Button 2 is pressed, it should enter the programming mode for setting the ON and OFF times for each day. The LCD display shows all adjustable variables(i.e. Day on the second row, ON time on the 3rd row, OFF time on the fourth row) indicating which variable is being adjusted. The user can then use Button 3 to adjust the variable, the user presses Button 4 to go to the next variable(i.e The user presses Button 2 to go into programming mode, then uses Button 3 to select the day that is to be set, then uses Button 4 to move to the next variable which is the Hour variable of the ON time, then uses button 3 to adjust the value, then uses button 4 again to move to the next variable and so on... ), pressing Button 2 after adjusting all desired variables should save the on and off time of the programmed day -
Button 3 (Adjust Variable):This button will be used to adjust the value of any variable during the programming mode. When Button 3 is pressed, it should increment the chosen variable's value by one. If the maximum variable value is reached, the value should wrap around to the minimum value.
-
Button 4 (Next Variable): This button will be used to move to the next variable to be adjusted during the programming mode. When Button 4 is pressed, it should move to the next variable's tab to let it be adjusted by Button 3
I have a code, but it doesn't work as intended, can someone help me analyze and find what i did wrong
I have attached a link to the wokwi simulation site with the code and simulated connections