Hi, Newbie here!
I'm not very good at coding (yet) and would appreciate your help with my project:
I have 2 mechanical encoders, each with 4-pin BCD output. One (A) has 6 positions and is used to select a category name, while the other (B) has 12 positions and is used to select one of 12 item names in each category (all different). I would like to use a 16x2 serial LCD to display the category name on line 1 and the item name on line 2.
The approach I'm contemplating is:
- Connect each encoder's 4 pins to 4 DIs on Arduino and apply VCC to each encoder's common pin.
- Scan the DI's every 500ms and store the encoders' position number
- Use a lookup table (1x6 array?) to determine the category name associated with encoder A's position number
- Use a 6x12 array to determine the item name associated with encoder B's position depending on what encoder A's position was.
- Clear the LCD and write the new names to the LCD
Will this work? Do I need two tables/arrays, or will one do?
The lookup table(s) or arrays are fixed; is there a clever way to upload them?
Thanks again!