10. Input devices¶
My Input Device¶
This week, my input device was a Greyhound single-pole, five-throw rotary key switch. I’m very grateful to Mr. Dubick for giving this to me for free, as it’s an expensive component on its own.
Breadboard Prototype¶
Before designing my PCB, I wanted to fully understand how the switch worked. Mr Dubick helped me trace a copy of the datasheet for the switch, which was pretty usefull to see. I also used a schematic I found on an Arduino forum to wire it onto the breadboard. The schematic used a pull-up resistor configuration for each switch position, with all of them connected to ground. I followed this setup and connected the necessary pins to the ESP. Everything worked fine.
During this process, I discovered that all pins, except for the selected one, are set to high by default. I made a mental note to account for this in my code later to ensure proper functionality.
After coding, this is what it looked like.
Coding¶
Coding was very simple, I turned all of the input pins to “Input-Pullup”, which set all of the input pins as pull up resistors. I then had the controller send a message through the serial monitor, telling me which switch was on.
Reflection¶
This week was pretty stressful because I had to work quickly before I got kicked out of the lab for spring break, however I think that it was also a very successful week. Not only have I gotten my work done very quickly, but I also have learned how to use a datasheet to aid in my design process.