demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Diff: RobotNode/NodeAX12.cpp
- Revision:
- 13:ffeff9b5e513
- Parent:
- 12:ac6c9d7f8c40
- Child:
- 15:4bd10f531cdc
--- a/RobotNode/NodeAX12.cpp Thu Jan 07 17:31:23 2016 +0000 +++ b/RobotNode/NodeAX12.cpp Fri Jan 15 22:02:46 2016 +0000 @@ -6,7 +6,7 @@ NodeAX12::NodeAX12(DynamixelBus* pbus, ServoId ID) : _Servo(pbus, ID) { - _LastPosition= 0.0f; + _LastPosition= 0; _LastTemperature = 0; _LastVoltage = 0; _LastLoad = 0; @@ -60,8 +60,11 @@ case NM_Load: val = (float)_Servo.GetLoad(); if (val != 0.0f) + { _LastLoad = val; + } return val; + default: return 0.0f; @@ -83,8 +86,8 @@ case NM_Load: return _LastLoad; - - default: + + default: return 0.0f; } }