Killed my nano with 5v on input pin - why?

Trying to learn a few things and killed a nano by putting 5v on pins 6 and 7 simultaneously (using a wire). They were not set as LOW outputs. Why did this happen?

int pin6 = 6; //pin #
int pin7 = 7; //pin #

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {

  if (digitalRead (pin6 == LOW && pin7 == LOW)) {
    slowblink();
  } else {
    fastblink();
  }
}




void slowblink ()
{
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);
}


void fastblink ()
{
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
}

Are you saying then that they were "killed" because that sketch doesn't yield the result you anticipate?

Because the board wasn't powered up at the time perhaps? Otherwise, what makes you think that you killed it?

You've not set pins 6 and 7 to inputs, I don't know what they default to but if it is output and low then that would explain it.

Sorry, 'Killed' as in will no longer connect. He's dead, Jim. Not responding, can no longer connect even out of the circuit.

They default to inputs.

"'Killed' as in will no longer connect."

On what do you base that conclusion?

if (digitalRead (pin6 == LOW && pin7 == LOW))

Are digitalReads combinative so?

I can see the port but that is it.

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1e

"Are digitalReads combinative so?"

I guess I don't understand the question. I want the either slowblink or fastblink to run based on both inputs being true of false.

Sometimes with clone Nanos, I have had the bootloader apparently vanish. Reloading it helped my suspected dead ones back to life.

ElHefe:
"Are digitalReads combinative so?"
I guess I don't understand the question.

He means is that the correct way to read 2 different input pins and combine the result, and if not, what is the correct way? Do some research.

I used this sketch to verify Inputting on 6 and 7.
Taking a pin HIGH should not result a board catastrophe.
digitalReads cannot be combined as your sketch attempts.

const byte Six = 6;
const byte Seven = 7;
byte together;

void setup() 
{
  Serial.begin(9600);
 
}
void loop() 
{
  together = 0;
  
  if (digitalRead(Six) == HIGH)
  {
    together = together + 6;
  }
  if (digitalRead(Seven) == HIGH)
  {
    together = together + 7;
  }
  Serial.println(together);
  delay(500);
}

PerryBebbington:
He means is that the correct way to read 2 different input pins and combine the result, and if not, what is the correct way? Do some research.

Ahh, ok. I will look in to that. Thanks both of you.

AJLElectronics:
Sometimes with clone Nanos, I have had the bootloader apparently vanish. Reloading it helped my suspected dead ones back to life.

Ill try that for sure.

runaway_pancake:
I used this sketch to verify Inputting on 6 and 7.
Taking a pin HIGH should not result a board catastrophe.

I know, that is why I'm so confused. I just ran a wire from the 5v pin to D6 and D7 and it killed it. I don't know why. It gets warm too. I have to admit I did it twice. If I do it again, that means I am insane, right? I don't want to be insane.

I had no trouble. Maybe you touched VIN instead? No guarantees there.

Using
pinMode(6,INPUT_PULLUP);
the pin is taken to Ground instead.

I just ran a wire from the 5v pin to D6 and D7 and it killed it.

This is normally just fine, as long as you never change wiring when the power is on.

It is NOT fine if you connect 5V to an output pin when (1) the microprocessor is not powered or (2) the pin is set to OUTPUT and LOW.

Of course, you may have accidentally connected 5V to some other (wrong) pin.

Just to make things clear, since the previous replies on this point seem very vague and confusing to me:

ElHefe:

if (digitalRead (pin6 == LOW && pin7 == LOW)) {

In this code, you're comparing the value of the pin6 and pin7 variables to the value of LOW. LOW is usually defined as 0 (though you shouldn't assume that), so pin6 == LOW && pin7 == LOW will always evaluate to false. Therefore, this code is the equivalent of:

if (digitalRead (false)) {

which is the equivalent of:

if (digitalRead (0)) {

So you're testing the state of pin 0, definitely not what you intended.

If your intention was to test whether both pin 6 and pin 7 are LOW, the correct code would look like this:

if (digitalRead(pin6) == LOW && digitalRead(pin7) == LOW)) {