Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store multiple values in registers ? #21

Open
nicolasvair opened this issue Apr 27, 2024 · 4 comments
Open

Store multiple values in registers ? #21

nicolasvair opened this issue Apr 27, 2024 · 4 comments

Comments

@nicolasvair
Copy link

Hi,

I have a question on how the encoder works. I'm doing a bluetooth midi controller and plan to have several pages of controls.

I read in the docs that the encoder have 4 adress bytes. Does it means that I can store 4 values ? Or are you using the 4 of them for one value ?

@Fattoresaimon
Copy link
Owner

Hello,
I think you are referring to the CVAL, CMAX, CMIN and ISTEP register.
They are 32bit register and they store 1 value. They use 4 register because a 32bit number is composed of 4 byte.

Thank you!

@nicolasvair
Copy link
Author

Allright, that what I thought.

I have then another related question. What would be the benefit of storing the value in the register rather than in an arduino variable ?

Thank you

@Fattoresaimon
Copy link
Owner

Fattoresaimon commented Apr 27, 2024

The I2C encoder keep counting when you rotate the encoder even if you don't read through the I2C command. This can happens when your arduino is busy with other tasks.
So in this way you will not miss the steps

@nicolasvair
Copy link
Author

Oh ok. That makes sense.

Thank you ! Those controllers and led rings are really great and well made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants