Shop OBEX P1 Docs P2 Docs Learn Events
Newbie Float question — Parallax Forums

Newbie Float question

Matthew JonesMatthew Jones Posts: 14
edited 2011-05-21 05:45 in Propeller 1
So I have tried to search this but I have no luck finding much on it.

I need to do some work on Floats then print them to the Serial Terminal (ST) to make sure everything lining up. Seems that when I work on a float I cannot print them to the ST
The following is just a small test to confirm my problem.

Con

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

cpin = 0
dpin = 1
spin = 2
poNum = 2.3333377777777777
peNum = 2.7777777777777777

OBJ

adc : "MCP3208"
pst : "Parallax Serial Terminal"
fa : "Float32Full"
fp : "FloatString"
VAR

Word printMe

PUB main

pst.start (115200)
printMe:=(fp.FloatToString(fa.Fadd(poNum,peNum)))
repeat
pst.str(string("my number:"))
pst.str(printMe)
pst.newline

I am just wondering what I am missing. Or is this just not possibility?

Thanks in advance
Matthew

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-05-21 05:27
    After pst.start(115200) add an fa.start.
  • Matthew JonesMatthew Jones Posts: 14
    edited 2011-05-21 05:38
    Oh Man, thanks alot.

    So How do I find out if I need to start a library or not? Is it always in the library. Is that just a standard for everything I include>

    Thanks again.
    Matthew
  • kuronekokuroneko Posts: 3,623
    edited 2011-05-21 05:41
    So How do I find out if I need to start a library or not?
    If it's well written then it's documented (most come with a simple demo). Otherwise you are on your own. It's usually either some form of start or init.
  • Matthew JonesMatthew Jones Posts: 14
    edited 2011-05-21 05:45
    Thanks again.
Sign In or Register to comment.