Hello.I use Proteus simulator and here is a schematic. I use an arduino nano, an ultrasonic sensor , l293d chip , a DC motor , lcd display and 2 buttons.The pins of each element don't seem (maybe because I use Ubuntu 20.04 running with Wine app, I don't know).
So,my problem is in 2 buttons,when I run the program, lcd displays 0,when I press the right button for 1st time ,it shows 1 ,but as many times as I press it again,lcd displays 1.
Here I have a video of how does it show.
Code: (I only mention the code of reading the button)
#include <LiquidCrystal.h>
LiquidCrystal lcd(9,8,7,6,5,4);
int button_RIGHT = 13;
void setup()
{
lcd.begin(20 , 4);
pinMode(button_RIGHT , INPUT);
}
void loop()
{
lcd.setCursor(0 , 1);
lcd.print( digitalRead(button_RIGHT) );
}