Returns information about the battery connected to the carrier.
battery.getRaw()
battery.getConverted()
battery.getFiltered()
#include <ArduinoMotorCarrier.h>
//Variable to store the battery voltage
float batteryVoltage;
...
void loop() {
batteryVoltage = battery.getRaw()/236.0; //236 for Nano, 77 for MKR.
Serial.print("Battery voltage: ");
Serial.print(batteryVoltage,3);
Serial.print("V, Raw ");
Serial.println(battery.getRaw());
delay(5000); //wait for a few seconds
}