#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("Hello World!");
}
void loop() { }
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2); l
cd.print("hello, world!");
}
void loop() {
lcd.setCursor(0, 1);
lcd.print(millis() / 1000);
}
I tried this codes, first one my code, second one is Arduino interface's ready code.
I connected lcd keypad and arduino as in links;
https://hizliresim.com/qTGXDw
https://hizliresim.com/z4EUPN
https://hizliresim.com/IMVdEA
https://hizliresim.com/OMRooG
My guess is that it's the wiring as it pertains to the setup for the LCD. You've got two difference set of setups, where you call the pins on the Arduino.
How can i fix this ? What's mean of difference set of setups ?
My DFR shield like that works with the pins 8, 9, 4, 5, 6, 7.
I tried this but its not solution.
Sorry I can't help: your top code (the 8, 9, 4, 5, 6, 7 one) shows Hello World on my DFR0009 shield.
I tried for buttons, they are working.
video : Buttons are working - YouTube
Code :
int ledUp = 8,ledDown = 9,ledRight = 10,ledLeft = 11;
void setup() {
Serial.begin(9600);
pinMode(ledUp,OUTPUT);
pinMode(ledDown,OUTPUT);
pinMode(ledRight,OUTPUT);
pinMode(ledLeft,OUTPUT);
}
void loop() {
int tus = analogRead(A0);
Serial.println(tus);
if(tus >= 350 && tus < 500){
digitalWrite(ledLeft,HIGH);
digitalWrite(ledDown,LOW);
digitalWrite(ledRight,LOW);
digitalWrite(ledUp,LOW);
}
else if(tus >= 160 && tus < 350){
digitalWrite(ledLeft,LOW);
digitalWrite(ledDown,HIGH);
digitalWrite(ledRight,LOW);
digitalWrite(ledUp,LOW);
}else if(tus >= 50 && tus < 160){
digitalWrite(ledLeft,LOW);
digitalWrite(ledDown,LOW);
digitalWrite(ledRight,LOW);
digitalWrite(ledUp,HIGH);
}else if(tus >= 0 && tus < 50){
digitalWrite(ledLeft,LOW);
digitalWrite(ledDown,LOW);
digitalWrite(ledRight,HIGH);
digitalWrite(ledUp,LOW);
}
else{
digitalWrite(ledLeft,LOW);
digitalWrite(ledDown,LOW);
digitalWrite(ledRight,LOW);
digitalWrite(ledUp,LOW);
}
}
The buttons all work off analog pin A0, so I would expect them to work even if the screen is stuffed.