Hi,
i am absolutelly beginner. I have problem with Arduino UNO. Or with myself ..
I want to visualize analog signal from A0 (3 digit places) on specific place in 16x2 display.
I use LiquidCrystal.h with inputs. not by i2c.
Thank for help,
Bob
Hi,
i am absolutelly beginner. I have problem with Arduino UNO. Or with myself ..
I want to visualize analog signal from A0 (3 digit places) on specific place in 16x2 display.
I use LiquidCrystal.h with inputs. not by i2c.
Thank for help,
Bob
Welcome to the forum
What code have you written so far and what problems are you having ?
Exactly which Uno board do you have ?
I have R3
For suggestions on how and what to post, have a look at the "How to get the best out of this forum" post, linked at the head of every forum category.
Among other things, you need to provide the details of all the modules in the project, including displays, sensors, etc. and a wiring diagram. Hand drawn is preferred.
You should get the display running first. Have you? If not, there are countless tutorials on line showing how.
And your code so far ?
Thats great ! But i want to wisalise digits like volts or ampers. Sorry please , i am almost 70-years old. and I am try to discover Arduino. Unfortulatelly dont find answer on gooogle. Sketch i find was unuseable ![]()
Like a thermometer?
Draw a picture and upload your idea here. We can help.
Have you tried the "Hello World" example sketch that came with the LCD library ? Does it work with your hardware ?
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
i delated all
Thats great ! Thank You !
You are kind of heading in the right direction but....
There is no need to repeat this multiple times. Just the once at the beginning of void setup() is fine.
This second repetition near the end of void setup() will clear everything that has been written to the LCD in the preceding statements. I don't think this is what you were intending? Is this what you actually have in your code, or is this a cut/paste error while copying into the forum?
BTW, could you edit your post and enclose the entire code in the CODE tags please. That would be helpful as it makes it easier for others to read.
PPS, assuming that you have the LiquidCrystal library installed, you should be able to find a number of examples right within the IDE under File -> Examples -> LiquidCrystal which you might find useful.
Thanks.
I modified and corrected your code (below)... it works in a simulation:
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup() {
pinMode(A0, INPUT);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("COG");
//lcd.setCursor(4, 0);
//lcd.print("127");
lcd.setCursor(0, 1);
lcd.print("SOG");
lcd.setCursor(4, 1);
lcd.print("5,0");
lcd.setCursor(8, 0);
lcd.print("TWS");
lcd.setCursor(12, 0);
lcd.print("6,9");
lcd.setCursor(8, 1);
lcd.print("DPT");
lcd.setCursor(12, 1);
lcd.print("40,1");
}
void loop() {
// Read sensor value
int sensorValue = analogRead (A0);
float voltage = sensorValue * (5.0 / 1023.0);
// Display voltage
lcd.setCursor (4, 0);
lcd.print(voltage);
}
Its working !!
Thank You !!
I learn with analogs..
So thank You.