janicefamily:
as for the people that are saying you cant do it, i'm really confused on why you say that? it seems to me it is totally possible. if all the resistors are in parallel, when 2 are engaged you will get a different reading. i realize i didn't post a schematic of how i'm thinking about wiring it, but please if your going to tell me it cant be done, tell me why so i can weigh my options. i'm not a pro but i know it technically can be done. now if its a good idea we shall see :
It's exactly because you haven't posted a schematic that you don't know why it can't be done (at the very least, not in any reliable fashion). There are two basic problems:
-
analog is well, analog. You won't get the same reading every time. So you need to have enough space for the readings to vary without looking like another value.
-
7 different button presses. And you need to be able to tell when any 1 or 2 is pressed. Which means each of the buttons and button combinations needs to present a different value to your pin. That's 7 (single button) + 6 + 5 + 4 + 3 + 2 + 1 (two buttons together) = 28 different values. That means 0.178V per step, if evenly spaced = 3.6% precision, best case.
So, let's assume a voltage divider where the top resistor is shared, and the bottom resistor is different for each switch.
For our first example, let's choose resistors incrementing in a binary fashion. For our test scenario, we'll choose 100 Ohms for the smallest resistor on the button side, giving us 100, 200, 400, 800, 1600, 3200 and 6400 for our resistors. And we'll choose the middle value, 800 ohms for the top resistor to make an even spread, with the middle button being a 50:50 voltage divider. For 5V, that would give us a range of 0.555V to 4.444V for a single button press. But if we press say buttons 1 and 7, the effective resistance is 98.46 ohms, giving us 0.548V, only 0.007V or 0.15% precision difference from our single button press.
But, parallel resistors don't combine like series resistors, so we don't need to increment in a binary fashion (i.e.:, doubling each time). Let's try linear incrementing as a ballpark best-case figure test. So, we'll select lower resistances of 100,200,300,400,500,600,700. And we choose the middle value, 400 ohms, for the upper resistor. working out the resistances, we see that when 1 and 6 are pressed together, we have 85 ohms in the bottom. When 1 and 7 are pressed together, the bottom parallel resistance is 87.5 ohms, giving us a 2.5 ohm difference. The voltage seen at the pin will be 0.876V with 1+6, and 0.897V with 1+7, a 0.4% voltage difference. Even with 1+4 vs 1+5 (more likely to represent a best-case resistance network instead of using the worst case linear version), the difference is 0.833V vs 0.862V = 0.6%.
As said above, why are you trying to do this with just 1 pin?