Hello,
I recently got an Arduino Nano, some jumpers and a small beadboard, I am not sure if my Arduino Nano is the version 3.0 or not, because those two versions got different pinouts, right?
This should be the 3.0 pinout:
And this should be the normal Nano pinout:
I "wrote" this code to identify where are pin 15 and 16, that way I would know which versions this Nano is, the thing is I wrote the code to turn off the built in LED once those two are connected, but it doesn't seem to work, any tips?
int val;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(16, INPUT);
pinMode(15, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(15, HIGH);
val = digitalRead(16);
if(val == HIGH)
{
digitalWrite(LED_BUILTIN, LOW);
}
else
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
}
}