I decided to look around here for a solution to my problem with my Arduino Uno board. When I plug it into the computer I do get that satisfying gong noise and I am able to see things printed to the serial monitor. However, when I attempt to run things that rely on the Digital pins, nothing happens. I decided to test this by individually going through and testing each pin. Here is the code I was using.
void setup() {
// put your setup code here, to run once:
pinMode(5, OUTPUT);
pinMode(7, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
pinMode(5, HIGH);
}
I kept just adjusting numbers to see if I could get an LED to light up. This did not work (yes I confirmed the LED was working with my multi meter, and that I had it the right way). I also tried running from the Digital Pin to Ground. This also did not work. I ended up using this code and flipping the board over to test with my multi meter. I ended up getting nothing.
Interestingly I've read lots of people recommend solving issues like this by looking at Pin 13, as it has a built in LED. This LED does indeed flash. When I put my own LED onto the pin however and connect it to ground, the built in LED on the Arduino turns off. Is this normal?
Please help! Not sure what's wrong with my board. It is a genuine board ordered off this website.
No I didn't. Might that be the problem? The LED still works when I test it so I know it isn't blown. The multi-meter still reads nothing out of the pins on the board as well.
If you put a LED on a pin without a resistor, you sort-of short the pin. Hence if you try that on pin 13, you short the pin and the on-board led will stop working.
Further there is a chance that you have the LED the wrong way around and it will never light up.
I just tried it with a resistor. Still nothing if I use any pins. Pin 13's light still goes out. I am not sure what resistor I am using (Never used them in projects). Still learning to read the codes on them. My LED is the right way. I've verified that the cathode is attached to the output pin (or pin 13) and that the anode is attached to either ground or my specified input pin.
That's the wrong way around. Anode is the positive side, cathode the negative side. So your options are
Anode to pin and cathode to GND; resistor can be between anode and pin or between cathode and GND.
2)
Anode to +5V and cathode to pin; resistor can be between 5V and anode or between cathode and pin.
Why would you connect a LED to the input pin? That pin is high impedance and barely current will flow through the LED.
Usual values for resistors are in the range of 220 .. 330 ohm (though variation is possible, depending on situation); use a multimeter to measure it if in doubt.
You can test your led with resistor by connecting it between 5V and GND. Once the led lights, you can take one side loose and connect it to an output pin.
//Edit
This link shows both a fritzing and a decent schematic as well as some code.
Thank you. Your link tutorial solved my problem. Turns out I had the LED and resistor set properly (I mixed the names of the two leads up. Apologies for that). My code was just wrong. I was using "pinMode(5, HIGH);" and expected that it would make power come out. Turns out you have to use digitalWrite for that.
Thank you for the help!
Now I just need to diagnose why GRBL is not working.