Let's Make Robots!

Arduino Uno (LCD(16x2) With Multiples Sreens(Menus) )

I want to connect on arduino uno two buttons So i can get in diffent menus of the lcd.My lcd in 16x2 and because it have 2 lines i can't put all the information i want so i want to make some menus to put my info in.How i must connect the wires and what is the code to make this possible.

 

I search in google but i found only lcd with keypad shield mine in only the lcd.Can someone help me with wiring diagram and coding?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Have you ever heard of google.com? With google you can search the complete internet. It's fantastic :p If you for example google "Arduino LCD menu tutorial" you get more then 170000 results. This link is at the top of the results: http://www.coagula.org/content/pages/tutorial-manage-menu-and-lcd-display-arduino

Bit of advice here.

Take a few sheets of paper. I personally take a 2 or 3 sheets of A4 if its something trivial, or if I am working on a large project I get an actual notebook (and then write up digital copies on google docs and scan my diagrams in). This is such a small project that you will be fine with a few sheets of paper.

Break things down into smaller steps. Write these down. In this case:
    Printing text to an LCD

    Taking some input from buttons.

    Using the buttons to cycle through a few menus to change what is printed.

3 little sub systems there. All linked yet all seperate at the same time.

From there you want to write down a heading for each sub system, take notes and write step by step details about how to accomplish each sub system. If needed break them down further.


Try to implement each sub system on its own.

only once you can think through and test how each sub system works independantly should you then try and piece them together. 


Taking input from buttons. Google "arduino push button", there are tonnes of results with wiring diagrams and tutorials on how to take input from a push button. I assume you have an LED somewhere and know how to make it blink. Wire it up ready to blink it, perhaps even run a blink sketch to check its working. connect your button, try and see can you get the LED to turn on when the button is held. You have 2 buttons. So as a more advanced project after the first, see can you get one button to act as an on button and the other as an off button.

 Printing text to an LCD, well, take your LCD and look for the model number on the back. Google "[model number] arduino". Chances are if you bought it from a reputable site such as adafruit or sparkfun they will have links to sample sketches, wiring diagrams and tutorials for it on the product page. Your aim here should be to fire up your arduino and have it print the string "Hello, World!" on its own. No other logic.

Menus. Actually. Might be a hardest part of the entire system (yet still not complex).
I would make up an array of the menu contents. ["dad", "mum", "brother", "sister"]. Note: I dont use arduino so I am not so familiar with how it handles strings, if your not familiar with strings either, well back to google :P I would then create a counter variable to act as a pointer. Set one button to increase the counter, another to decrease. And then just a tiny bit of code that ensures that the counter doesnt go too high or low (in the case of the array I wrote above, you want the only possible values to be 0, 1, 2 and 3. Or basically, dont let it get below 0 or greater than 3) which can possibly be combined with the button press code in the first place (if counter < 3, counter = counter + 1) . Then when you need to print to the screen you print the text referenced by the counter, usually done somewhat like this: arrayname[counter]. If its zero it should print dad.
This will all need changing for work with the arduino environment, even if I was more familiar I would probably not  help much more than this. I think there is plenty there to think on. 

 

 

Most of those LCD shields with a keypad actually have the button pad wired up independantly of the LCD so are actually no different from what I have just told you to do.