
// READ_VOLT_TEST

// Read sensors

int Sensepinleft = 4 ;                           // Define PIN A4 for left Sensor
int Sensepinright = 3 ;                          // Define PIN A3 for right Sensor
int Sensevalueleft;                              // Define variable for sensorvalue left
int Sensevalueright;                             // Define variable for sensorvalue right

// Status LEDs
int Ledbat = 3;                                  // Define PIN 3 for digital output red LED
int Ledstart = 4;                                // Define PIN 4 for digital output green LED

// Read Battery voltage
int Voltpin = 0;                                 // Define PIN A0 for reading battery voltage
float Volt;                                      // Define variable for voltage

void setup() {                                   // Setup

  // Print
  Serial.begin(9600);                            // Start the serial communication

  // Status LEDs
  pinMode(Ledbat, OUTPUT);                       // Define Ledbat PIN as OUTPUT
  pinMode(Ledstart, OUTPUT);                     // Define Ledstart PIN as OUTPUT  
  
}


void loop() {                                   // Start main programm


 Volt = analogRead(Voltpin);                    // Read voltage from PIN A0
 Volt = Volt * 0.02765;                         // 0.02765 is factor for voltagedevider 22K / 4,7K

 Serial.print(" Battery voltage = ");          // Print text without linefeed
 Serial.println(Volt);                          // Print Volt-Value with linefeed                    
 Serial.println(" ");                           // Print nothing as a linefeed

  delay(500);                                   // Wait 500ms

}


