Print LCD Text Justify from Right


hi guys,

   i trying display duty cycle value 0 100, , whenever lcd prints 100 , reduce duty cycle 50, shows 500. how can either remove these zeros or format print right-justified? here excerpt of code:

code: [select]

  lcd.setcursor(1, 1); // sets cursor column 0, line 1
  lcd.print((val1 / 4) * 100 / 255); // prints digital pin 5 duty cycle lcd


the thing have been able dig use sprintf function, i'm not entirely sure how this?

any guidance?

change second line
 lcd.print(val1 * 0.09803921568);

and how have thie input setup?


Arduino Forum > Using Arduino > Programming Questions > Print LCD Text Justify from Right


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'