1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

current trip values on PROG depending on state

This commit is contained in:
Harald Barth
2020-09-27 12:14:25 +02:00
parent 6911d9ed01
commit c14596a252
5 changed files with 25 additions and 19 deletions

View File

@@ -76,6 +76,9 @@ int MotorDriver::getCurrentRaw() {
return analogReadFast(currentPin);
}
unsigned int MotorDriver::convertToMilliamps( int raw) {
unsigned int MotorDriver::raw2mA( int raw) {
return (unsigned int)(raw * senseFactor);
}
int MotorDriver::mA2raw( unsigned int mA) {
return (int)(mA / senseFactor);
}