Simple (I hope) problem with FloatString
derekf
Posts: 3
I don't know what I have changed.
This is about as simple of a floating point test program as I can come up with:
It has worked in the past. I've seen it. It showed me "2.5" as pretty as you please, and I called it good... and then when I tried to build something useful using it, it stopped working there and also stopped working here. Now it gets hung up at the FloatToString and never shows a value there nor gets to the "Ending" text.
I've replaced my copy of FloatString with the v1.2 from http://obex.parallax.com/object/236 and it didn't help. I am using Float32 in the FloatString instead of FloatMath. I'm sure it's something simple but I've been bouncing my head off this for a couple of days and it's time to ask folks who know things. Can any of y'all point me in the right direction?
This is about as simple of a floating point test program as I can come up with:
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ pst : "Parallax Serial Terminal" f : "Float32" fs : "FloatString" PUB test3 | fa, fb f.Start pst.Start(115_200) pst.Str(String("Starting.")) pst.NewLine fa := f.FFloat(5) fb := f.FDiv(fa, 2.0) pst.Str(fs.FloatToString(fb)) pst.NewLine pst.Str(String("Ending."))
It has worked in the past. I've seen it. It showed me "2.5" as pretty as you please, and I called it good... and then when I tried to build something useful using it, it stopped working there and also stopped working here. Now it gets hung up at the FloatToString and never shows a value there nor gets to the "Ending" text.
I've replaced my copy of FloatString with the v1.2 from http://obex.parallax.com/object/236 and it didn't help. I am using Float32 in the FloatString instead of FloatMath. I'm sure it's something simple but I've been bouncing my head off this for a couple of days and it's time to ask folks who know things. Can any of y'all point me in the right direction?
Comments
Are you starting this object (on demand)? Since FloatString itself doesn't feature a start method it's the most likely cause.
Thank you for taking a look at this.
Thank you, kuroneko. I don't know why it worked for me before and then stopped... but now it works again and I appreciate it!