Shop OBEX P1 Docs P2 Docs Learn Events
Beginner, help displaying sine table with fullduplexserialplus — Parallax Forums

Beginner, help displaying sine table with fullduplexserialplus

bikejunkybikejunky Posts: 33
edited 2010-10-13 17:58 in Propeller 1
Beginner, needs help displaying sine table with fullduplexserialplus
I've went through the Propeller Ed. kit labs, and the forum examples
I'm just trying to display Sine table with the serial terminal.
Here is one of the several attemps I have made.

OBJ

Debug : "FullDuplexSerialPlus"
fMath : "Float32Full"
fString : "FloatString"


PUB TwoWayCom | a, b, c,I


fMath.start
Debug.start(31, 30, 0, 57600)
Waitcnt(clkfreq*2 + cnt)
Debug.tx(Debug#CLS)


repeat I from 0 to 90
c := fmath.Sin(I)

debug.str(fstring.FloatToString(c))
debug.str(string(13))

The only time I get any thing that makes any sense is when I put in individual value to the fmath.sin
I think it has something to do with how Integer and float numbers are handled

Thanks
Charlie

Comments

  • Rick_HRick_H Posts: 116
    edited 2010-10-13 17:45
    float32 needs a floating point sent as the parameter. try this-


    c := fmath.Sin(fmath.FFloat(i))
  • bikejunkybikejunky Posts: 33
    edited 2010-10-13 17:58
    Rick Thank You, It worked like a charm

    Charlie
Sign In or Register to comment.