how to code Day Month and Year on two
Dogg
Posts: 4
· Need Help:
···················· I am looking for information on how to code Day Month· and Year on two
··················· Pushbuttion Control. Any help or code would be appreciated. I using a BS2E
··················· Stamp.
··················· Thanks Dogg.
Post Edited By Moderator (Bean (Hitt Consulting)) : 11/21/2009 2:49:41 PM GMT
Comments
·SRLM:
····
········· ······ Here is the code That I am trying to design two Push-Buttons to Control.
········· Date:
················· Enter Month:
······································· Serout 16,B96,[noparse][[/noparse]CR,"Enter Month (1.....12)..]
········································Serin 16,B96,[noparse][[/noparse]DEC2 month]
······································ ·IF(month < 1) Or (Month > 12)Then Enter_Month
················ ·Enter_Day:
····································· · Serout 16,B96,[noparse][[/noparse]CR,"Enter Day· (1....31).."]
····································· · Serin· 16,B96,[noparse][[/noparse]DEC2 day]
····································· · IF(day· < 1) Or (day > 31)Then Enter_Day
············· · Enter_Year:····
···································· ··Serout 16,B96,[noparse][[/noparse]CR,Enter Year (00).."]
····································· ·Serin 16,B96,[noparse][[/noparse]DEC2 Year]
····································· ·F(Year < 02)Then Enter Year
················Any assistance would be very much appreciated. I am only trying to Input the above
·············· Information on two Pushbuttons switches to set the month day and year...
············· Thank you for your time and input.· PS: Baud is 9600
·············
··············Dogg
·······································
·· Mike:
··········· Thanks for the quick reply.
··········· What I am trying to accomplish is take two N/O Pushbuttions to set the month day and year.
··········· If this is possible.
············The day would be set and then incremented to the month with the same pushbutton. And
·········· finally the year would be set with the second Pushbutton. Any help would be appreciated.
·········· Again thanks for the quick reply.
········· Dogg..
If you know how to handle pushbuttons, then how would you do what you want to do? What specific button presses would do what? It sounds from your description that you have a "mode" where the first mode is "set month", the second mode is "set day", and the third mode is "set year". Modes are also known as states in programming. How would you progress from the initial state to each of the three other states, then back? What might a pseudo-program look like? How would you keep track of what mode you're in? There are several different ways including the use of a variable or the use of a particular loop / label in the program.
·· Mike:
·········· Thanks for your Help.
·········· Dogg