Go Down

Topic: Assign a Value to an encoder (Read 293 times) previous topic - next topic

seby20

Hi, if I reaceive a value in midi in, let say 100.
How do I assign that 100 value to an encoder so that the encoder knows that the next time I turn it, it should start with that value in mind.

Do you have a code example for this please?

tks
Seby

Grumpy_Mike

Code: [Select]
encoder = 100;
Just like any other assignment of variables. Where the variable encoder is defined as a volatile byte and is altered in the ISR triggered by changes in the encoder's output pins.

Delta_G

Hi, if I reaceive a value in midi in, let say 100.
How do I assign that 100 value to an encoder so that the encoder knows that the next time I turn it, it should start with that value in mind.

Do you have a code example for this please?

tks
Seby

You've got it backwards.  You don't tell an encoder where to start counting because encoders don't count.  They just give you pulses.  And your code can interpret those pulses and count them or whatever you want to do with them.  And if you want your code to start counting from some given number then count from that number in your code. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Go Up