0

Incremental encoder using GPIO and variables

Hello,

 

I have an incremental encoder and I want to know if I can use GPIO ports, but just for recording data in some variables and not to be used as command directly. 

 

Let's say my encoder has 2 pins : A and B. When I turn the encoder, A and B value change from 0 to 1 and vice versa in a certain manner. Is it possible to plug A and B pins in ports 3 and 4 (button 0 and 1) of the GPIO and then continuously save the values in two variables ?

After that, I would like to make some operations on the variables to determine the direction of rotation, and then send a command to a video according to the result ... but this will be another step.

4 comments

  • 0
    Avatar
    acalleja

    In my opinion, I would connect the encoder to an Arduino Controller (or similar) in charge of the encoder logic.

    And this Arduino can be connected via USB/Serial to the Brightsign Player. A communication protocol need to be implemented in order to  update variables,  speed and direction of playback...

  • 0
    Avatar
    Maxime Christiano

    Thanks for your answer. So finally it is not possible to save data coming from GPIO in variables ?

    But you are probably right, it is probably a proper way to do it. But I want it to keep it simpler as possible. Do you think I can do the same with an electronic circuit with logical gates to have 1 (5V) on port 3 when it is clockwise, and 1 on port 4 when it is CCW ? And then assign the good command for each.

     

     

  • 0
    Avatar
    Bright Scripters

    GPIO event in BrightAuthor could be used to update a User Variable.

    At what frequency do you expect the logic state on the GPIO pins to change?

     

    BrightScript offers other ways to respond to GPIO pin changes

    https://docs.brightsign.biz/display/DOC/roControlUp%2C+roControlDown

    https://docs.brightsign.biz/display/DOC/roControlPort

  • 0
    Avatar
    Maxime Christiano

    Thank you for your answer but finally I've kept the Arduino solution, way simpler.

    Hope it could help someone else anyway !

Please sign in to leave a comment.