I have a rotary switch set up as an input to the arduino to control which channel the software selects. This causes various outputs (20 or so) to be set either HIGH or LOW.
For some reason, four voltages are being outputted by the board, 0V, 1.4V, 3.6V and 5V where I was only expecting 0 and 5. Depending on the channel 1.4V and 3.6V can be used either as the high or low voltage.
My board is an arduino 1280 mega and is only using digital pins. I have tried powering it from both the USB and the Power Pack and this makes no difference.
Each pin can achieve up to 5V and does when different channels are selected. The only thing the switch changes are which ones are on/off. There's 5V going through the switch into the arduino, should this be changed?
Yes they are and No there's no pull-up resistors. I've ran this code before and it worked fine, however I had to change some of the pin numbers so that the whole thing would be easier to assemble. This is a new problem
Each pin can achieve up to 5V and does when different channels are selected. The only thing the switch changes are which ones are on/off. There's 5V going through the switch into the arduino, should this be changed?
So you see voltage drops when multiple channels are ON, while when only one channel is ON you see 5 V ?
Sorry i explained that poorly, only one channel can be selected at once.
E.g in position one, the switch will input 5V to the arduino and the outputs will have a low voltage of 0V and a high of 1.4V
in postition 2, HIGH= 3.6 LOW =1.4V
in position 3, HIGH=5V LOW=3.6V
You still are explaining it poorly. We need a schematic. It sounds like you are doing something quite silly like feeding 5V directly into an output pin.
connecteing the other pin of the switch to ground changes nothing, I've tried it. Also the switch must always be connected to one of the pins. The resistors only make the problem worse.
...in position one, the switch will input 5V to the arduino and the outputs will have a low voltage of 0V and a high of 1.4V
in postition 2, HIGH= 3.6 LOW =1.4V
in position 3, HIGH=5V LOW=3.6V
What do you want to say by this? Which of the 9 outputs?
What i was trying to say was that high should be 5v and regularly isnt, low should be 0v and regularly isnt. No pin is consistent in its high and low voltages.
It has been fixed now by simply not having a switch over pins one and zero which seemed to be screwing the thing up to high hell.
connecteing the other pin of the switch to ground changes nothing, I've tried it.
Then you haven't tried it right. Go back and see exactly what I said.
The situation you describes has floating input pins, you might think you have fixed it but you haven't if you still have floating input pins. It just happens to work.
Were you using a digital meter to measure the output voltage, it could be that it is oscillating and thus giving you a reading between 0 and 5v. It could be oscillating BECAUSE you have floating pins.
Were you using the serial port in your program Leanne? If so that could be your main problem. Pins 0 and 1 are the hardware serial pins though they can be used as digital pins as long as serial is not used.