FloatMath.spin Problem
crgwbr
Posts: 614
I'm using the FloatMath object to to multiply a variable (Set_Depth) by 108.··Here is the·line of code:
Set_Depth := FloatMath.FMul(Set_Depth,108)
The variable Set_Depth is entered by a user earlier on.· It should just take Set_Depth and multiply it by 108, then put the answer back in Set_Depth.· For some reason though, it's just putting 0 in Set_Depth; no matter what the user entered.· I've been working on the problem for·5 hours; I can't figure out what's going on.· Anyone have an Idea?
Thanks,
crgwbr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Set_Depth := FloatMath.FMul(Set_Depth,108)
The variable Set_Depth is entered by a user earlier on.· It should just take Set_Depth and multiply it by 108, then put the answer back in Set_Depth.· For some reason though, it's just putting 0 in Set_Depth; no matter what the user entered.· I've been working on the problem for·5 hours; I can't figure out what's going on.· Anyone have an Idea?
Thanks,
crgwbr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
PUB Get_Depth
Serial.Str(string("!NB0R02"))
Set_Depth := Serial.rxDec
Set_Depth := FM.FMul(Set_Depth,108.000)
Depth := FS.FloatToString(Set_Depth)
Serial[noparse][[/noparse]0].Str(string("Display Started, Depth Returned from Pink: "))
Serial[noparse][[/noparse]0].Str(Depth)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Anyway, just use "Set_Depth := FM.FFloat(Serial.rxDec)". I think that'll help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life