Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed X_NUCLEO_PLC01A1 ros_lib_melodic
Diff: ms-94bzb.cpp
- Revision:
- 3:ea5cfd721b53
- Parent:
- 1:ef4b86795d79
--- a/ms-94bzb.cpp Sat Aug 15 09:21:36 2020 +0000 +++ b/ms-94bzb.cpp Sun Aug 30 06:39:43 2020 +0000 @@ -84,4 +84,14 @@ */ void MS_94BZB::setAcceleration(uint16_t accel){ _accel = (uint16_t)(_gearRatio*accel); +} + +uint16_t MS_94BZB::getInputVoltage(){ + uint16_t CAN_ID = STATE_COMMAND_2|_motorID; + unsigned char *rMsg; + rMsg = _pCanController->recieveMessage( CAN_ID ); + if(rMsg != _pCanController->_NoData){ + _voltage = rMsg[5]<<8 + rMsg[6]; + } + return _voltage; } \ No newline at end of file