aduri
Newbie level 4
LCD without zero
Hello,
This code (Mikrobasic) converts an analogical value in a binary for a radio frequency control.
This's the code:
This is my problem:
When the value is lower than 10 (e.g. 9), I'd like the LCD to visualise the number 09
I tried with the IF code, but it doesn't work.
Ciao
Antonio
Hello,
This code (Mikrobasic) converts an analogical value in a binary for a radio frequency control.
This's the code:
Code:
cod_fine:
byteAdcbin1 = Dec2Bcd16(ValoreAdc1) ' conversione da decimale a binario
if (ValoreAdc1 =0) then portb=255 'led or contraves on pins 32 to 40
else
if (ValoreAdc1<100) then portb = not byteAdcbin1
end if
end if
if (ValoreAdc1 >99) then ValoreAdc1 =99 '
end if
if (ValoreAdc1<10) then LCD_out(1,11,"0") '
end if
bytetostr(ValoreAdc1,txt1)
LCD_out(1,10,txt1)
This is my problem:
When the value is lower than 10 (e.g. 9), I'd like the LCD to visualise the number 09
I tried with the IF code, but it doesn't work.
Ciao
Antonio