// Method to update the display private void sendToDisplay() { if (_prevState == _State) { if (_State == state.charging) { var chargingProgress = (((500 - (int)readCurrent) * 100) / 495); Console.Write("\r Progress: {0} / 100 % Press (R) to read RFID and cancel the the charging process!", chargingProgress); } return; } switch (_State) { case state.notCharging: _Display.NotCharging(); _prevState = state.notCharging; break; case state.fullyCharge: _Display.ChargingComplet(); _prevState = state.fullyCharge; break; case state.charging: _Display.ChargingInProgress(); _prevState = state.charging; break; case state.chargingError: _Display.ChargingErorMsg(); _prevState = state.chargingError; break; default: break; } }