Hi
When I change Voltage on A0, U1 should show same thing but I have all the time zero - 0
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //uno
float V = 0;
int U1;
void setup() {
pinMode(A0, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
V = analogRead(A0);
V = V / 1024 * 5.0;
/////////////////////
if (V != V)
{
U1 = V;
}
/////////////////////
Serial.print("V= ");
Serial.print(V);
Serial.print(" U1= ");
Serial.println(U1);
lcd.setCursor(6, 1); //Place the cursor at Line 1, Column 6. From here the
lcd.print(V, 1); //Print the number of val on the LCD
lcd.print("V");
delay(100);
}
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //uno
float V = 0;
float U1;
float currentV;
void setup() {
pinMode(A0, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
V = analogRead(A0);
V = V / 1024 * 5.0;
/////////////////////
if (currentV != V)
{
U1 = V;
}
/////////////////////
Serial.print("V= ");
Serial.print(V);
Serial.print(" U1= ");
Serial.println(U1);
lcd.setCursor(6, 1); //Place the cursor at Line 1, Column 6. From here the
lcd.print(V, 1); //Print the number of val on the LCD
lcd.print("V");
delay(100);
}