Buonasera a tutti,
ho un'improvviso vuoto di memoria, perchè nel codice allegato viene aggiunto 48 nelle istruzioni di estrazione delle cifre?
non mi ricordo più.....
Grazie per l'aiuto
v = ADC_Read(2); // Read analog value from channel 2
v = ((v*4.89)/5)*20; // V GOES FROM 0 TO 20 volts
// Resolution 10 bits ( 0......1023)
if(v!=vp )
vp = v;
volt[0] = (v/10000)+ 48; // Extract volts (thousands of millivolts) from result
// Write result in ASCII format
volt[1] = (v/1000)%10+48; // Extract thousands of mv
volt[3] = (v/100)%10+48; // Extract hundreds of mv
volt[4] = (v/10)%10+48; // Extract tens of millivolts if you want the format 00.000
Lcd_Out(4,1,"Voltage= ");
Lcd_Out(4,9,volt);
Delay_ms(200);