Shop OBEX P1 Docs P2 Docs Learn Events
multiply middle help? — Parallax Forums

multiply middle help?

ducky101ducky101 Posts: 2
edited 2008-11-21 21:18 in General Discussion
Ive been searching, looking through help files and trying to wrap my head around why this line of code isnt working. im relatively new to sx and am no programmer but as far as i can tell it matches the documents. but i must be missing something.

the line of code is (sx/b)
duty = sxcontroller */ $028C

where duty and sxcontroller are byte sized and the $028C is hex for 2.55, im trying to scale a a value ranging b/w 0-100(sx controller) to 0-255(duty)

the error i get is line 90, error 8, pass 1: invalid parameter "*/"

i noticed only the star lights up blue and not the slash where other commands like // light totally blue but ** is totally grayed out. so kinda confusted on all that.. i must be overlooking something small. appreciate any help!

Comments

  • BeanBean Posts: 8,129
    edited 2008-11-21 21:07
    */ only works with WORD variables.

    Are duty and sxcontroller both WORD vars ?

    I'm not sure why the highlighting doesn't work right.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
    www.iElectronicDesigns.com

    ·
  • ducky101ducky101 Posts: 2
    edited 2008-11-21 21:18
    that would be the problem.. the example didnt really show what the var's where.. i now look over the wording more and see the light of my error. although doesnt seem very intuitive to me. sorry for the confusion.. but thanks for the quick reply!
Sign In or Register to comment.