http://msdn.microsof...y/etb4xxec.aspx
and ran this code which absolutely clobbered my Netduino. Fortunately, I managed to restore it. I tried it a second time and this time it also crashed Visual Studio and my PC.
using System; using Microsoft.SPOT; namespace GetBytes_Netduino_Program { public class Program { public static void Main() { byte[] theBytes = singleBytes.getSingleBytes(1234.55f); } } public class singleBytes { public static byte[] getSingleBytes(float number) { byte[] theBytes; unsafe { byte* p = (byte*)&number; theBytes = new byte[sizeof(float)]; for (int i = 0; i < sizeof(float); ++i) { theBytes[i] = *p; p++; } } return theBytes; } } }If I run this as a windows console application the result is: [0] = 154, [1] = 81, [2] = 154, [3] = 68. Are there any other methods to accomplish this task on a Netduino Plus?
Baxter