I know there's an internal regulator, but the battery pack I have selected is in the hole of 6 volts. And you can't feed 5 or 6 volts into the regulator, right? Once I get out of prototype and into production with this, I have the option for a higher voltage pack.
You'd better not use the pin connected to the onboard led as an input with the internal pullup, the easiest way is to use another pin, you'll have no problem with any other, if you want to keep USB feature, P3/P4 must be kept.
I thought pin 0 had the LED? I was leaving pin 0 empty because of that.
Speaking of pins, in testing (see new diagram), I noticed that pins 5 and 6 yeilded different results when they were set to go high. Pin 5 was able to drive the LED and the transistor/siren fine. Pin 6 is not able to drive the LED to the same brightness, nor is it able to drive the transistor/siren (no sound). I don't understand why this is the way it is.
The orange line is a manual test right now. Eventually that will be a set of RCA cables that loop around something. This wire will be 20 - 60' round trip. Does that change anything?
void setup(){
pinMode(1,INPUT); //detects circuit
pinMode(2,INPUT); // debug reset
pinMode(4,OUTPUT); // LED for alarm
pinMode(5,OUTPUT); // siren
digitalWrite(4,LOW);
digitalWrite(5,LOW);
} // end setup()
void loop(){
if(digitalRead(1)==LOW){
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
} // end if
if(digitalRead(1)==HIGH){
digitalWrite(4,LOW);
digitalWrite(5,LOW);
} // end if
} // end loop()