Shop OBEX P1 Docs P2 Docs Learn Events
Problem with DynamicMathLib — Parallax Forums

Problem with DynamicMathLib

electric550electric550 Posts: 122
edited 2009-08-03 07:54 in Propeller 1
Has anybody experiance problems withe the FCos(a), FSin(a), FTan(a) commands in the DynamicMathLib? The other functions are working fine for me but the ones mentioned are getting stuck in a loop when the function is called, so the program just stops. Any suggestions.

con ''These are from Float32 and require a cog no matter what

PUB FSin(a)
  restart1
  'return sendCmd(SinCmd + @a)
  command := SinCmd + @a
  repeat while command
  stop1
  return cmdReturn  
   
PUB FCos(a)
  'return sendCmd(CosCmd + @a)
  command := CosCmd + @a
  repeat while command
  return cmdReturn  

PUB FTan(a)
  restart
  'return sendCmd(TanCmd + @a)
  command := TanCmd + @a
  repeat while command
  stop1
  return cmdReturn



The above functions are locking up when I run them. I was wondering if anyone had a similar problem or if someone knows how to fix this? Thanks

Also the degree version of the commands return from the loop but they are returning incorrect values when I run them.

Post Edited (electric550) : 8/3/2009 2:49:19 AM GMT

Comments

  • electric550electric550 Posts: 122
    edited 2009-08-03 07:50
    Well I don't know if anyone else had the above problem...maybe I downloaded a weird version Anyways I changed the above to
    PUB FSin(a)
      restart
      'return sendCmd(SinCmd + @a)
      command := SinCmd + @a
      repeat while command
      stop
      return cmdReturn  
    
    PUB FCos(a)
      restart
      'return sendCmd(CosCmd + @a)
      command := CosCmd + @a
      repeat while command
      stop
      return cmdReturn  
    
    PUB FTan(a)
      restart
      'return sendCmd(TanCmd + @a)
      command := TanCmd + @a
      repeat while command
      stop
      return cmdReturn
    
    



    and it works now.
  • electric550electric550 Posts: 122
    edited 2009-08-03 07:54
    I just checked obex and this is the version on there is the one that was giving the trouble. Someone might want to fix the one in obex, or perhaps put an explanation of how to use the one in obex. It might be trying to conserve cogs or something but I am not sure, but I can't complain, Thanks for all the math! It is very useful
Sign In or Register to comment.