This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
OK so I built up a circuit on a perfboard. It has a button. I noticed that my Serial output was not showing the change/button press/pull to GND.
The perfboard has female headers for an Arduino Nano. Fearing a wiring or soldering mistake or oversight, I removed the Nano(clone, old bootloader) from my perfboard headers, and wrote this basic test:
//Button tester
#define buttonpin 12
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(buttonpin, INPUT_PULLUP);
Serial.println("*****************************");
}
void loop() {
// put your main code here, to run repeatedly:
int buttonstate=digitalRead(buttonpin);
delay(250);
if(buttonstate=1){
Serial.println(buttonstate);
}
else if(buttonstate=0){
Serial.println("OTHER");
}
}
I tested pins 4,5,6 and 12 by connecting a dupont female-to-female header to the pin in the code, and both GND pins, each in-turn. The Serial output continuously indicated that the pin was HIGH.
So now I'm thinking, I've fried my Nano clone.
So I go grab another one that I hadn't unwrapped yet.
Same story...any digital pin, either ground, either with our without the internal pullups, no change in state.
How do I test properly out-of-circuit? Is there something I'm missing?
I've continuity checked my perfboard as well, but I can't even plug the Nano back in until I can do a successful button press?
I'm honestly confused. I'd get it if I'd fried Nano1 and Nano2 worked, but there is obviously some piece of knowledge that I lack.
Please note that at no time was Nano2 ever plugged into my perfboard. I opened the static bag and plugged it right into usb, uploaded the test, yada yada yada.
Just for giggles, I used HIGH and LOW in the "IF" statements. I also tested the input pins as output with a simple on/delay/off/delay and they worked just fine.
Thoughts?
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/arduino/com...