I'm a new Aurdino user and I'm trying to create a project to hsow heat, moisture and clock&date information to PCD854 screen. with bellow connection I can read the values and print them on to screen without problem. I want to add three button to setup clock and date butwhen I connect the buttons to digital pins, Aurdino read the digital pin value as a High always and I couldn't find the what is problem. Right I just add below code to see if button press function is working or not but even if I don't press the button, it shows as pressed all time. Is there any suggestion to solve issue?
You clearly put much time into preparing your neat fritzing diagram. But it seems to be at a lower resolution than similar images I’ve seen, making the UNO text difficult to read.
@udemirdere
Your diagram looks OK and so does the code.
So I suspect you have a wiring error on your actual breadboard.
Are you sure you have the switches in the right way?
Maybe show a picture of the actual breadboard.
You are taking a big risk. Using the blue/black bus line of the breadboard for 5V is an accident waiting to happen. Always use the blue/black bus for ground. Maybe use the red line on one side of the BB for 5V and the red line on the other side of the BB for 3.3V. This won't prevent all mistakes, if course, but it should significantly reduce the risk.
Here is something to check: often the bus lines on BBs can have a break in the middle which you need to connect across with wire. Normally the break is indicated by a gap in the red & blue/black lines also.
Such little push buttons with their very short legs may not make (good) contact with the breadboard.
Use your multimeter to confirm that they actually make contact - and that the voltage on the Arduino input pin actually changes when you press the button.
@udemirdere
On some breadboards there is an interruption of the +V and GND tracks as I marked in the image.
See if this is not the case with your breadboard.
if (durum1 == HIGH) {
display.println("1. buton");
}
if (durum2 == HIGH) {
Serial.println("2. buton");
}
if (durum3 == HIGH) {
Serial.println("3. buton");
}
display.display();
delay(1000);
line 108 : display.println("1. buton"); display.println ???? Is correct?
line 112: Serial.println("2. buton"); Seria.println
line 116: Serial.println("3. buton"); Serial.println
I took below pictures from my bread board. in addition to these pictures, I tried to connect buttons to separate ground from UNO and it didn't make any difference. do you have any suggestion for button confugurition?
you right I forgot to correct code display all three button on screen. but I can read the value from serial monitor and it's again show that I push the button. I add screen shot on my general answer.
thank you
you right,
all night I jusst changed the 5V pins to buttons but I didn't changed ground pins. I just realized that when I'm writing to answer your entry. thank you, now it's solved.
Well, THIS is the problem:
Here you must connect (with a jumper or another cable) one blue/red rail with the other blue/red (topmost blue one is the culprit in your case) because top and bottom blue/red rails aren't connected from one side to the other.
Besides, for the future I suggest you a better wire color coding.
First of all, ALWAYS use black wires for GND and red for +5V. This is crucial (and sometimes vital for the devices...).
For other wire types make your kinda "standard" choice (e.g. like yellow for analog inputs, blue for digital, green for buttons, and so on), but always get stuck with "your" standard and avoid mixing colors for the same connection type.