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.
Revision 5:b2bc6e87890f, committed 2021-11-04
- Comitter:
- gert_lauritsen
- Date:
- Thu Nov 04 18:01:57 2021 +0000
- Parent:
- 4:1679a9439241
- Commit message:
- pub
Changed in this revision
| ComLink.cpp | Show annotated file Show diff for this revision Revisions of this file |
| ComLink.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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
--- a/ComLink.h Wed Mar 09 13:25:31 2016 +0000 +++ b/ComLink.h Thu Nov 04 18:01:57 2021 +0000 @@ -62,7 +62,7 @@ int Work(); //Sender - void StatusUpdate(float Vout,float Iout,float Irotor,float Temp,float Vbat); + void StatusUpdate(float Vout,float Iout,float Irotor); //Generator data void TxErrStateArr(float *value, int Size); void TxSetStateArr(float *value, int Size);