 
   lcd.setCursor(0, 1);
   lcd.print("Bat: ");
-  lcd.print(batteryVoltage);
+  lcd.print(smoothBattery.getValue());
   lcd.print("V   ");
 }
 
 void loop() {
   uint8_t speed = 0;
   uint8_t currentGas = gas.getValue();
-  uint8_t currentBatteryVoltage = getBatteryVoltage();
+  uint8_t currentBatteryVoltage = battery.getValue();
   
   smoothGas.update(currentGas);
+  smoothBattery.update(currentBatteryVoltage);
 
   // Different max speed, when driving backwards
   if (motor.isForwards()) {

#include <Arduino.h>
#include <Bounce2.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include "Motor.h"
#include "GasPedal.h"
#include "ExponentialSmoothing.h"
#include "settings.h"


uint8_t newDirection = DIRECTION_NONE;
float batteryVoltage = 0.0;

Bounce switchForward = Bounce();
Bounce switchBackward = Bounce();

Motor motor = Motor(PIN_ENABLE_R, PIN_PWM_R, PIN_ENABLE_L, PIN_PWM_L);
GasPedal gas = GasPedal(PIN_GAS_PEDAL, GAS_VALUE_MIN, GAS_VALUE_MAX);

ExponentialSmoothing smoothGas = ExponentialSmoothing(ExponentialSmoothing::DEFAULT_ALPHA);

LiquidCrystal_I2C lcd(0x27, 16, 2);


  lcd.backlight();
  
  lcd.setCursor(0, 0);
}

void updateDisplay() {
