Hi, I'm trying to create a program where it displays "AbC" one at a time. For every keypress of button 1 it should cycle from A->b->C and go back to A. For button 2, it is the opposite of button 1, from C->b ->A. button 1 and button 2 can be pressed anytime. For example, If the current display is “A” pressing button 2 would display “C” then pressing button 1 will display it back to “A” and so forth. Button 3 is used to blank the display and reset the operation.
The problem that I encounter is that when I press the button 1 it will cycle only once through Abc then it will not cycle again it is just stuck to last letter and won't change and same for the button 2..And also I cant change the letter if I press between button 1 and button 2
More members will see your code if posted properly. Read the how get the most out of this forum sticky to see how to properly post code. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code in code tags.
My suggestion: First implement the function of button 1! The 3 codes for the characters (A, b, C) belong in an array that is addressed with an index 0 ... 2. The index must be extrapolated modulo 3.
If that works, do (almost) the same with button 2, the index must then be decremented and set back to 2 at -1.
Once you change sevState1 to 3 there is no 'if' statement to make that state do anything. Perhaps you should go back to sevState1=0; instead of sevState1=3;