hello can some one help rotary encoders on ebay for arduino use
been building a unit that has a grey code encoder required the information on the net is baffling me
it has 5 pins the same layout as a ky040 encoder this is an incremental one [2 pin side switch 3 pin side encoder out] recently used this ky040 model works a [dds signal generator for HF] this works OK
the centre pin of three on this ky model is connected to ground OK
Is the centre pin on the grey code model ground also ??
please i don’t want to sound stupid but not used encoders much purely a hobbyist here
if some one could point me in the correct direction much appreciated
sorry this is the code i have modified the code for 20x4 display on i2c and added swr meter on lines 2-3 not posted code yet as still working on prototype it verifies ok so in build mode the unit is on KD1JV web page
that is very helpful "frank grey inventor" but how is this connected to wiring the encoder ??? question does it require positive voltage to work or not
You evidently need to understand what a "pull-up" is.
The ATmegas (and many or most other microcontrollers) provide internal pull-up functions (generally by a FET rather than an actual resistor) which can be enabled by the INPUT_PULLUP mode in pinMode. So (all) the common switch connections connect to ground.
RP thanks for the explanation so power is not required separately it is derived from A0 A1 that’s fine will test and let you know the outcome unfortunately i am an old fart 60 never learned programming was not born with that skill 30 years as an mechanical engineer i find the best way for me to learn a skill is by doing a project so thanks again