Good morning I am getting the arduino uno with the lcd monitor. i want to ask is how can i with every of the five buttons when i push them to show the message and when i leave them not show the message.every button individually.thank
Good afternoon (depends on where you are on this globe, but it's afternoon where you are now too i guess), and welcome.
You didn't give enough information in your question for us to answer it.
I understood you ordered an Uno, you told so.
Also you ordered a LCD Keypad Shield (you called it LCD monitor, which is not accurate), because you are asking about how to read out and display the keys.
The problem with that is that there are a lot of similar LCD Keypad shields, and they aren't always built the same way.
So we need to know which one you ordered (i guess you haven't received it yet).
You can put some links to the parts you have ordered, so we know what we're talking about.
I also understand English isn't your native language, so i'm not blaming you for anything, i'm just pointing out we need more information.
these are the links of the parts that i order and i want to connect 5 switches and every time that a switch works to give me a message on the screen
thank you


Attached docuements refer to a product called a "Keypad Shield" , that was discussed in another post.
The Manufacturer's (LindSprite) webpage for this product is here:
http://linksprite.com/wiki/index.php5?title=16_X_2_LCD_Keypad_Shield_for_Arduino#FAQ
You don't need to purchase it although it would be the ideal solution for your application because it
already has the buttons. Since you did not purchase this product you will have to add the buttons
to your existing equipment you already posted. Here is an example of what you need to buy. They
are available from many vendors: This is just an example of one:
When you wire them up like the attached schematic.
The transistor shown has a part number that was probably meant for china. The datasheet is attached but
if I were you I wouldn't even worry about it. Just use a 2N2222 or a 2N3904. Either of these is equal or
better than the 9013 and much more available. Basically any general purpose small signal npn transistor
will work.
You have the schematic, parts lists, datasheets and links. That should pretty much cover it.
Any thing else you need ?

1602+LCD+Shield+Sch.pdf (163 KB)
lcd_1602_keypad_shield.ino (1.61 KB)
9013.pdf (80.3 KB)
That is a really good project to get you familiar with microcontrollers but you have to break it into several steps before you try for your final result. I would suggest that you get five LEDs and appropriate current limiting resistors in addition to the parts you have already mentioned.
First you want to write a program that will light one LED when you press a switch and turn it off when you release the switch.
Next you want to do the same for two LEDs, then three, then four, etc.
You have already used a lot of Arduino pins for the switches and LEDs but there are enough left for your LCD since the so called 'analog' pins can also be used if you didn't use them for your LEDs or switches.
The next step would be to get the 'LCD working. Use a simple sketch such as this one. You don't have to use the Arduino pins that I did, use what ever pins are available.
#include <LiquidCrystal.h>
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // put your pin numbers here
void setup()
{
lcd.begin(16, 2); // put your LCD parameters here
lcd.print("hello, world!");
lcd.setCursor(0,1)
lcd.print("it works!");
}
void loop()
{
}
Finally go back to your Switch/LED program and substitute the display of a message for the lighting of an LED.
Don
Don,
I'm not following how leds got into this. I didn't see any mention of them in his original post.
raschemmel:
I'm not following how leds got into this. I didn't see any mention of them in his original post.
Don is suggesting getting things to work with LEDs first as a learning exercise because it is ease to do.
ssakiss1:
these are the links of the parts that i order
No they are not links they are photographs and not much good. We need the URL of the data sheet of what you have bought.
I'm not following how leds got into this. I didn't see any mention of them in his original post.
I knew it was a bad idea to put two sentences into that paragraph....
Don
Thanks for the clarification Mike,
FYI, I included the code for the keypad shield.
The lcd on that shield works with fm's library and the constructor is the one for that shield so that would
need to be changed to match the OP's LCD.
If he can get his lcd working then the attached program already does what he wants.
It is modified from the original vendor's example to more closely suite the OP's objective.
It prints the key # on line 1 and "Message for key""[key]" on line 2. He can edit the message to suit his needs.
Hi raschemmel.
It is clear this is all new to TS.
I already typed some sentences telling him to start with the blink sketch, and adding some LEDs, a potentiometer and some switches, because i thought TS was skipping the basics.
I erased those lines because i didn't want to be too strict about beginning at the start.
Of course anyone is tempted to start at chapter 8 or so, skipping the basics.
But the smart thing to do, is to start at the beginning.
I did start at that beginning and it took me about a weekend to have 6 LEDs light up using PWM, and have them light up rotating clockwise or anticlockwise (they were placed in a circle on a breadboard), with a speed set by a potentiometer.
Not everyone needs to have the same start, but using a display (and understanding what's happening) as a first project seems a bit too steep to me.
Understood. (what's TS ?)
I'd like to see how you did the light chaser code.
ssakiss1:
Where are you at with all of this ? Are you following it ? Let us know where you are at technically
so we can post accordingly ,please.
With TS i meant Topic Starter (sometimes also referred to as OP; Original Poster).
I think i have tossed that chaser code, as it was based on the blink sketch and all the versions i built clogged up the "sketchbook".
I'll have a look for it later.
No worries.
Yeah, I'm familiar with the term OP, but hadn't seen the TS (is that like Fire Starter ?)
So since we haven't heard from the TS, I suppose he's MIA ...
Robert
i found this code from a thermometer,all the indications are in the first row, in the second row i want to adjust the 5 button code that i mentioned in a previus status code: #include <LiquidCrystal.h>
float tempC = 0;
float tempf = 0;
int tempPin = 0;
float samples[8];
float maxi = 0,mini = 100;
int i;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(5, 0);
lcd.print("message");
lcd.setCursor(2, 1);
lcd.print("message");
delay(5000);
lcd.clear();
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayLeft();
delay(200);
}
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
lcd.scrollDisplayRight();
delay(200);
}
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
lcd.scrollDisplayLeft();
delay(200);
}
delay(500);
delay(1000);
lcd.clear();
}
void loop()
{
Serial.println("");
Serial.println("You are looking at a project built by WWC.");
Serial.print("Feal free to use and modife as needed.");
Serial.println("");
Serial.print("LM35 Raw data: ");
Serial.println(analogRead(tempPin));
for(i = 0;i<=7;i++){
samples _= ( 4.4 * analogRead(tempPin) * 100.0) / 1024.0; _
Serial.println(samples*); *
*lcd.setCursor(0, 0); *
*lcd.print("message:"); *
*lcd.setCursor(15, 0); *
*lcd.print("C"); *
*lcd.setCursor(8, 0); *
lcd.print(samples*); *
tempC = tempC + samples*; *
*delay(800); *
*} *
*Serial.println(""); *
*Serial.println(""); *
*tempC = tempC/8.0; *
tempf = (tempC * 9)/ 5 + 32;
*if(tempC > maxi) {maxi = tempC;} *
*if(tempC < mini) {mini = tempC;} *
Serial.println("New measurement:");
*Serial.print(" Average Temperature in Celcius is " ); *
Serial.println(tempC);
*Serial.print(" Average Temperature in Farenait is " ); *
Serial.println(tempf);
*Serial.print(" MAX Temperature in Celcius is " ); *
Serial.println(maxi);
*Serial.print(" MIN Temperature in Celcius is " ); *
Serial.println(mini);
*delay(6000); *
*tempC = 0; *
}
Before we go any further , could you please click on the "Modify " button and redo this post
using the CODE button [#] <= above with the "#" symbol on it.
Highlight the code then click on the [#] (CODE) button.
This will create a window in which people can scroll through the code.
When your done doing that click the "Save" button to complete the edit.
When you have time , read this:
http://forum.arduino.cc/index.php?topic=149018.0
If you enter any web links, highlight them and click on the LINK button (the one with the Globe symbol)
You need to be more specific.
Have you connected the lcd and tested it yet ?
Is that working ?
in the second row i want to adjust the 5 button code that i mentioned in a previus status
Adjust how ?
How much experience do you have programming and wiring circuits, so we can save time by not explaining what
you already know ?
So since we haven't heard from the TS, I suppose he's MIA ...
Well you did hijack his thread so what do you expect?
Don
Well you did hijack his thread so what do you expect?
There is nothing stopping the OP from posting a reply so don't make up accusations about hijacking a thread.
He asked for something in his original post, and I gave it to him in Reply #3. If he chooses not to use it that's
his choice, but don't blame me for his delay in responding , as you recall , you did ask him to go off and breadboard
some leds , remember ? Maybe that is what he was busy doing . I don't know and everyone knows you don't
either so lighten up. If you can find fault with anything I said to the OP, then please say so. I would like to hear
it. I think the OP can speak for himself.