LCD shows 2 of the 3 numbers


i started work lcd , have troubles it.
i tried hello world examples , worked perfectly.
now wanted show outputvalue of potentiometer.
i have put in right place shows 2 of 3 numbers.
it goes 0 90 , 10. know how solve this?

#include <liquidcrystal.h>

liquidcrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
 
  lcd.begin(16, 2);

  lcd.print("hello, world!");
}

void loop() {
  int sensorvalue = analogread(a0);
  int outputvalue = map(sensorvalue, 1023, 0, 25, 0);

  lcd.setcursor(0, 1);

  lcd.print(millis()/1000);
 
  lcd.setcursor(5, 1);
  lcd.print(outputvalue);
}

are sure getting correct value outputvalue after map() function ?  try printing on serial monitor eliminate problem lcd.

look @ parameters map().  is 1023 lowest input value expect , 0 highest ?

quote
it shows 2 of 3 numbers.
why think 3 numbers out of map() when mapping input range 0 25 ?


Arduino Forum > Using Arduino > Programming Questions > LCD shows 2 of the 3 numbers


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code