Greetings! ![]()
Have just started to play with Arduino gadgets and have used a prototyping shield to mount momentary push buttons as per attached pix.
The buttons connect GND to input pins and seem to be working using test code based on the DigitialInputPullup code from Examples.
The test code tries to turn on the pin13 LED for a second and print text corresponding to the button pushed.
The current mystery is that there seems to be something odd regarding pin 1 in that when pressed, the pin13 LED does get turned on but the Serial.println() call doesn't seem to happen (text doesn't show up in the Serial monitor).
I've even copied the pin 1 input if() test as an extra test after the others and action and it still does not print the debug text.
Is there something about pin 1 that I'm no aware of?
Thank you in advance of any help.
Regards,
Tom.
Test code:
void setup() {
 //start serial connection
 Serial.begin(9600);
 //configure pin 2 as an input and enable the internal pull-up resistor
 pinMode(1, INPUT_PULLUP);
 pinMode(2, INPUT_PULLUP);
 pinMode(3, INPUT_PULLUP);
 pinMode(4, INPUT_PULLUP);
 pinMode(5, INPUT_PULLUP);
 pinMode(6, INPUT_PULLUP);
 pinMode(13, OUTPUT);
}
void loop() {
 //read the pushbutton values into variables
 int butn_1_Val = digitalRead(1);
 int butn_2_Val = digitalRead(2);
 int butn_3_Val = digitalRead(3);
 int butn_4_Val = digitalRead(4);
 int butn_5_Val = digitalRead(5);
 int butn_6_Val = digitalRead(6);
Â
 // REMEMBER: With pushbutton inputs set to INPUT_PULLUP, the
 // logic is inverted: LOW == pressed, HIGH == off
 //
 if ( butn_1_Val == LOW ) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 1 ..."));
  delay(1000);
 }
 else if (butn_2_Val == LOW) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 2 ..."));
  delay(1000);
 }
 else if (butn_3_Val == LOW) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 3 ..."));
  delay(1000);
 }
 else if (butn_4_Val == LOW) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 4 ..."));
  delay(1000);
 }
 else if (butn_5_Val == LOW) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 5 ..."));
  delay(1000);
 }
 else if (butn_1_Val == LOW) {
  digitalWrite(13, HIGH);
  Serial.println ();
  Serial.println (F("BUTTON __ 1 ..."));
  delay(1000);
 }
 else {
  digitalWrite(13, LOW);
 }
}
