Shop OBEX P1 Docs P2 Docs Learn Events
Absolute Binary Rotary Encoder Position — Parallax Forums

Absolute Binary Rotary Encoder Position

Luis_PLuis_P Posts: 246
edited 2012-03-04 22:09 in BASIC Stamp
Hi:
I could not pass the position of the encoder to a variable, the example code only shows hoe to debug on screen. This is the code


DEBUG CRSRXY, 7, 3, HEX1 INA ' Display position in hexadecimal


Displays the position of encoder correctly. How do I pass that value to a variable?

Thanks!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-03-04 11:44
    myvar = INA
    DEBUG CRSRXY, 7, 3, HEX1 myvar ' Display position saved in myvar in hexadecimal
    

    -Phil
  • Luis_PLuis_P Posts: 246
    edited 2012-03-04 22:06
    myvar = INA
    DEBUG CRSRXY, 7, 3, HEX1 myvar ' Display position saved in myvar in hexadecimal
    

    -Phil

    There is a way to pass value to the variable without debuging? I don't need to display the value, just pass to the var.

    Gracias!
    Luis
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-03-04 22:09
    Yes, just delete the DEBUG statement. The assignment is done in the line above it.

    -Phil
Sign In or Register to comment.