Show an image of how you are wired to the Arduino.Attach "your" sketch for us to see (use code tags).
Serial.print("lastState = ");Serial.println(lastState);delay(1000);
I see nothing in your code to navigate back up the tree once you have selected a Family part so theservo never returns to 0. If you had button names defined in addition to "states" it would be easier to follow.UPDOWNLEFTRIGHTSELECTTry running the attached code (after changing the LCD Constructor to match your pins) and see what I mean.It displays the button pressed. If it can do that , it can tell you where you are in the tree as well (ie: Level-1,Level-2 etc.There doesn't seem to be any error messages displayed if you press the wrong button and without anymenu tree location feedback it is impossible to tell where you are or why you can't get back (like fromCFM 1. Once you get there you're stuck and not going anywhere.)
When designing electronic equipment that encorporates a combination of buttons and display, it is customary, during the Design Review , to create a menu tree that is ultimately printed out and included in the User Guide that is shipped with the product. By looking at the menu tree and looking at the display,it is possible to know at all times where exactly you are because a code number or acronym is displayed identifying the exact location in the tree. There are only 5 choices UP,DOWN, LEFT, RIGHT & SELECT. When the user looks at the printed menu tree , he knows which way he needs to go to get to his destination in the tree and he can always arrow down to the BACK button to get back up the tree.It appears there are some code blocks missing from your code. Is this the complete version or a partial preliminary version ? (there is a prompt to enter a part number but no code to enter it)
1.1 CFM Part 2 1.2 CFM Part 2 1.3 CFM Part 3 1.4 CFM Part 4
Is that tree similar to what you mean?
Yes, only it seems your code is unfinished and there is nothing beyond that point yet.Is that correct ?It appears there are some code blocks missing from your code. Is this the complete version or a partial preliminary version ? (there is a prompt to enter a part number but no code to enter it)Also , I have problems getting back up the menu and the servo doesn't reset to 0 if yougo back to starting point.
No, this is no where near complete, just my initial attempt. I don't have any previous experience in programming or hardware.