FaqT0tum / Arduino_GraphicMenu_Encoder

This sketch allows you to create a graphic menu with the help of a rotary encoder such as the KY-040. The code was created to be used with the SD1306 OLED display via the Adafruit_SD1106 and Adafruit_GFX libraries To convert the img use the online tool: http://javl.github.io/image2cpp/
12 stars 1 forks source link

Clarification on sketch variables #1

Open m-r-m-s opened 3 years ago

m-r-m-s commented 3 years ago

Hi @FaqT0tum ,

I am trying to understand your sketch and wondering about the selPin and selSens variables.

Can you please explain how they are incorporated into the menu sketch?

I am not using the KY-040 but a similar, directly connected rotary encoder with push button switch so I need to make a few modifications to the sketch.

  1. selPinis what connects the SW push button switch of the encoder to the board correct?
  2. What does the selSens = 0 variable declaration do?

Thanks so much for any info you can provide. I really appreciate it!

FaqT0tum commented 3 years ago

hello, the sketch has been commented on purpose in the points you should see the arrows to help the user to change the pins on the board ... in your case if you use a rotary encoder similar to the KY-040 you shouldn't need to make any changes in how much they are equal, unless you use anything else as optical encoder or other ... that said if you need the encoder there are 3 variables that you will find in the "Encoder" section which are called (DT; CLK; encBut) respectively DT and CLK are the pins for rotation and encBut is the pin of the encoder key

Il giorno 30 lug 2021, alle ore 18:40, mmryspace @.***> ha scritto:

Hi @FaqT0tum https://github.com/FaqT0tum ,

I am trying to understand your sketch and wondering about the selPin and selSens variables.

Can you please explain how they are incorporated into the menu sketch?

I am not using the KY-040 but a similar, directly connected rotary encoder with push button switch so I need to make a few modifications to the sketch.

selPinis what connects the SW push button switch of the encoder to the board correct? What does the selSens = 0 variable declaration do? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FaqT0tum/Arduino_GraphicMenu_Encoder/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQP7R7VFHN7PVO5MKDRLHYTT2LIZTANCNFSM5BI3L3RQ.

m-r-m-s commented 3 years ago

Hi,

Thank you so much for your reply. However, I think you may be referencing your Orbion code here?

I am looking at the code here: https://github.com/FaqT0tum/Arduino_GraphicMenu_Encoder/blob/main/GraphicMenu.ino

I understand that DT, CLK, and push are the encoder / button pin variables but I am trying to understand your sketch and wondering about the selPin and selSens variables:

selPin = 10 is pin what connects the SW push button switch of the KY-040 encoder to the board?

What does the selSens = 0 variable declaration do?

Thanks again for your help.