# Code Listing

#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int sensorPin0 = A0, sensorPin1 = A1;
float a,b,c,d,e,f;
float sensorValue0 = 0, sensorValue1 = 0;  // store values from sensors
float fudge = 2.40/1024 ; // for External 2.4 V reference

void setup() {
lcd.begin(16, 2);    // set up the LCD's number of columns and rows:
analogReference(EXTERNAL);
}

void loop() {
sensorValue0 = analogRead(sensorPin0);
sensorValue1 = analogRead(sensorPin1);

lcd.setCursor(0, 0) ;
//  lcd.print("W0PCE  QRP Meter  "); // normal operation
a=sensorValue0*fudge ;
b=sensorValue1*fudge ;
lcd.print("Vf=");    lcd.print(a); // diagnostic operation
lcd.print("  Vr=");  lcd.print(b);

lcd.setCursor(0, 1) ;
c=2*(b-a) ;
d=pow(10, c);
e=(1+d)/(1-d) ;
lcd.print("  VSWR = ");  lcd.print(e);
delay(500);
}

