Hello esteemed forum,
I am a complete novice in electronics and to the wonderful world of the PIC (slowly but surely getting there!).I am working on a PIC project whereby i set the count how many times a switch is pressed before illuminating a LED i.e. LED lights up after the switch is pressed 8 times or 10 times or 12 times etc. This count should be set outside of the PIC and once set is constant until the "count" is changed. I thought of doing this with a Hex/Binary coded rotary switch (See image). This rotary switch would connect to four pins on the PIC with a single input to the rotary switch. My questions are the following :
1. Is this the correct way to achieve this?
2. On a Hex coded switch there are 16 switch settings and only four connections. How are 16 options achieved with only four inputs?
3. Am I correct in assuming that this rotary switch would give me 16 options i.e. 6/8/10/12/14/16 etc different key press options to light the LED?
4. How would the software in the PIC detect 16 options if 16 options in fact is what I will get?
Thank you in advance.
Barry.
I am a complete novice in electronics and to the wonderful world of the PIC (slowly but surely getting there!).I am working on a PIC project whereby i set the count how many times a switch is pressed before illuminating a LED i.e. LED lights up after the switch is pressed 8 times or 10 times or 12 times etc. This count should be set outside of the PIC and once set is constant until the "count" is changed. I thought of doing this with a Hex/Binary coded rotary switch (See image). This rotary switch would connect to four pins on the PIC with a single input to the rotary switch. My questions are the following :
1. Is this the correct way to achieve this?
2. On a Hex coded switch there are 16 switch settings and only four connections. How are 16 options achieved with only four inputs?
3. Am I correct in assuming that this rotary switch would give me 16 options i.e. 6/8/10/12/14/16 etc different key press options to light the LED?
4. How would the software in the PIC detect 16 options if 16 options in fact is what I will get?
Thank you in advance.
Barry.