Show Posts
Pages: 1 2 3 [4]
46  Using Arduino / Programming Questions / Fload value on: January 07, 2013, 04:08:48 pm
hi all,

i have made:

Code:
lcd.setCursor(0, 1);                       
    int AFCvalue = analogRead(A1);               // Read the AFC input on analog pin 1:
    float AFC = AFCvalue * (4.5 / 1023.0);       // Convert the AFC value (which goes from 0 - 1023) to a voltage (0 - 5V)
   
   if (AFC>2)                                    // A videosignal wil be present higher then 2 volts!
   
{
    digitalWrite(Lockled, HIGH);                 // Turn Lock LED "ON" when Tuner are Locked on frequency
    lcd.setCursor(0,0);
    lcd.print("  L ");
    lcd.print(AFC);
    delay(dt);

   else
{
    digitalWrite(Lockled, LOW);                  // Turn Lock LED "OFF" when Tuner have no signal
    lcd.setCursor(0,0);
    lcd.print("  U ");
    lcd.print(AFC);
    delay(dt);

The output on the LCD "2,38" volt.

My project need a more specific value. example 2,3875 volt. So 4 or maybe 5 digits more are exacter.

what code can i use to make this working?


Edwin
Pages: 1 2 3 [4]