I'm currently tearing my hair out and wondered if any of you could assist in sparing me the early onset of male pattern baldness.
Background :
I'm trying to set up an art installation which involves a rotary phone. I'm alright at coding but electronics confuses me somewhat.
Set up :
Two buttons normally closed, one normally open which pulses (the rotary dial). I've got the software decoding the dial on its own, but as soon as I start adding tests for switches (one is the phone latch, the other is when the dial has been moved) I start shorting the board. I know I'm connecting things wrong but don't know where to start, can someone give me a brief overview of the pin connections, what goes +5v what goes gnd, where I stick a resistor and how i should set the pins up (pulses are low not high).
aha! thank you I'm beginning to see my ineptitude. the always high, low pulse pin is now sorted, i was putting it high and running 5v to it.
however I'm having issues with another pin which should be set low and then tested for high, when low its flicking between values, it sorts itself if i run a resister between it and ground but i though i shouldn't have to do this if i used digital.write?
yep I get that but i thought that as the new boards had a built in pull down resistor once i had declared a pin 'low' I wouldn't need an external pull down resistor here's the set up code
int pulsePin = 3;
int dialPin = 4;
int latchPin = 5;
unsigned long counter = 0;
unsigned long duration = 0;
unsigned long timeout = 100000; // in microseconds
void setup() {
pinMode(pulsePin, INPUT);
pinMode(dialPin, INPUT);
pinMode(latchPin, INPUT);
// enable the 20K pull-up resistor to steer
// the input pin to a HIGH reading.
digitalWrite(pulsePin, HIGH);
digitalWrite(dialPin, LOW);
digitalWrite(latchPin, LOW);
Serial.begin(9600);
Serial.println("Here we go again");
}