I would like to know how I can work with floating point numbers in App Inventor, it seems to hide types as much as possible and that's not cool.
Nope, just gave it a shot. Instead it's displaying the byte
representation of my numbers (which are constants for now); I've tried
sending the data both MSB first and LSB first with the same results. My microcontroller is behaving just fine though; when it receives a command (115 or 67), it responds with the desired information.
So for instance, the label for cadence (sent LSB first) is Cadence: (219 15 73 64) and the label for speed (sent MSB first) is Speed: (63 157 243 182) for the floating point numbers 3.14159265392 and 1.234 respectively. The numbers make sense; that's the correct floating point byte representation. But again, I need this information concatenated into one floating-point number.
--To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/eafb7371-e1a8-4ff2-8fb4-35a2ee7fe59a%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventort...@googlegroups.com.
Visit this group at http://groups.google.com/group/mitappinventortest.

Thanks Liz,The reason is because I tried sending the data both ways just to see if the app would recognize it. So I sent one of the MSB first and the other LSB first.
On Monday, April 21, 2014 4:41:23 PM UTC-4, lizlooney wrote:
Frank,I noticed that the bytes you receive for cadence (219 15 73 64) are little endian but the bytes you receive for speed (63 157 243 182) are big endian. How'd that happen?-Liz
On Mon, Apr 21, 2014 at 1:13 PM, Liz Looney <lizl...@google.com> wrote:
Hi Frank,After re-reading about single precision floating point, I was able to parse (by hand) the cadence value of (219 15 73 64) and get the value of 3.14159274101258, which is pretty close to 3.14159265392.I'll work on the blocks this afternoon/evening and post a picture of them in this thread.
-Liz
On Mon, Apr 21, 2014 at 11:10 AM, Liz Looney <lizl...@google.com> wrote:
Frank,I think you are going to have to construct the floating point number yourself from the bytes you receive using the ReceiveUnsignedBytes block. I haven't needed to do that with AppInventor yet, but I'll give it a whirl.What floating point format does your microcontroller use? 4 bytes implies a single precision floating point (see http://en.wikipedia.org/wiki/Single-precision_floating-point_format), but I tried parsing your cadence value of (219 15 73 64) and couldn't get it to equal 3.14159265392.-Liz
On Mon, Apr 21, 2014 at 10:44 AM, Frank <fpern...@gmail.com> wrote:
Oh, and just for the record, I also tried using the ReceiveText block instead. It just displays the data as ASCII, still not much use.
On Monday, April 21, 2014 10:13:27 AM UTC-4, Taifun wrote:I would like to know how I can work with floating point numbers in App Inventor, it seems to hide types as much as possible and that's not cool.actually that's very cool...you don't have to worry about data types, it just works... just try...Taifun
--
You received this message because you are subscribed to the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventortest+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/eafb7371-e1a8-4ff2-8fb4-35a2ee7fe59a%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventort...@googlegroups.com.
Visit this group at http://groups.google.com/group/mitappinventortest.
To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/1c06e2d1-0558-40d9-832d-c42ac98f91f9%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventortest+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/eafb7371-e1a8-4ff2-8fb4-35a2ee7fe59a%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventortest+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/mitappinventortest.
Thank you, Thank you, Thank you! It works like a charm, I wouldn't even know how to repay you for this.
On an unrelated note though, how did you get your blocks so nicely shaped like that? All my math blocks are arranged horizontally rather than vertically like yours, which results in a long string of blocks. Your blocks look very compact and well placed. I was hoping my blocks would arrange themselves like that automatically, but nope.
--
You received this message because you are subscribed to the Google Groups "MIT App Inventor Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mitappinventort...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mitappinventortest/7ed4b61f-7581-4f00-9c75-5f76019ddd34%40googlegroups.com.