init
Diff: ComLink.cpp
- Revision:
- 5:b2bc6e87890f
- Parent:
- 4:1679a9439241
--- a/ComLink.cpp Wed Mar 09 13:25:31 2016 +0000 +++ b/ComLink.cpp Thu Nov 04 18:01:57 2021 +0000 @@ -204,4 +204,19 @@ void ComLink::cls() { Senddata(7,0,""); -} \ No newline at end of file +} + +void ComLink::StatusUpdate(float Vout,float Iout,float Irotor) { + char OutStr[40]; + union { + char bytes[4]; + float val; + } Float2Byte; + Float2Byte.val=Vout; + memcpy(&OutStr[0],&Float2Byte.bytes[0],4); + Float2Byte.val=Iout; + memcpy(&OutStr[4],&Float2Byte.bytes[0],4); + Float2Byte.val=Irotor; + memcpy(&OutStr[8],&Float2Byte.bytes[0],4); + Senddata(9,12,OutStr); +} \ No newline at end of file