I want to convert a Float (and Integer) value to a Byte array.
Or in other words:
The Float numbers are internally represented by 4 Bytes and Integer numbers by 2 Bytes.
These Bytes I want to copy into a custom data frame (encoded as Byte array) and send it by UDP (using TINA).
After some searches I found the Pascal command move, which could be used for the conversion task.
The AVRco compiler manual just has a side note that the move command is supported.
Unfortunately the compiler doesn't like my code and I didn't find any AVRco related information in the web.
// definition
testFloat :Float;
floBytes :Array[0..3] of Byte;
// conversion test
testFloat := 3;
move(testFloat, floBytes, 4); // ERROR: var or symbol expected
I would be happy about some hints.
Or in other words:
The Float numbers are internally represented by 4 Bytes and Integer numbers by 2 Bytes.
These Bytes I want to copy into a custom data frame (encoded as Byte array) and send it by UDP (using TINA).
After some searches I found the Pascal command move, which could be used for the conversion task.
The AVRco compiler manual just has a side note that the move command is supported.
Unfortunately the compiler doesn't like my code and I didn't find any AVRco related information in the web.
Code
// definition
testFloat :Float;
floBytes :Array[0..3] of Byte;
// conversion test
testFloat := 3;
move(testFloat, floBytes, 4); // ERROR: var or symbol expected
I would be happy about some hints.