I'm new to Arduino and I was trying out my new board (Rev2 WiFi) but I have discovered I am unable to make use of the digital pins for some reason.
I have tried the example Blink from the IDE and it works just fine, but when I try to use an external pin it doesn't work.
I've tried lighting an external LED and can't do it, nor I can activate a simple DC motor that I have. The weird thing is that if I connect the motor directly to the 5V output and GND of the board, it works perfectly; it's only when I try to use the pins that it doesn't work
Here's a simple code sample I used to test the motor:
Ground was directly connected to GND directly and the other side was connected to a pin (I tried different pins to no effect):
const int in1 = 6;
void setup() {
// put your setup code here, to run once:
pinMode(in1, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(in1, HIGH);
}
I have also tried using a L298N motor controller with this code:
const int enA = 10;
const int in1 = 9;
const int in2 = 8;
void setup() {
// put your setup code here, to run once:
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(in1, HIGH);
digitalWrite(in2, HIGH);
analogWrite(enA,255);
}
Keep it simple and stupid.
Run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.
The motor is less than 5V so why does that not work?
I do not have a power source like that at hand but I will try that as soon as I can get one, I appreciate the help and apologize for my lack of knowledge, it's really my first time using an Arduino board
It's a 3V motor with 590ma current so if I'm not mistaken it should be around 5Ω.
Due to the nature of my project I wanted to power the Arduino board from a socket directly and then power 2 of the 298N, but seeing what you explained I understand that could be not possible
Oh! Yes, sorry it seems that specific LED I was using was faulty and didn't work, it was not an issue with the pins. I got so focused on the motor part that I forgot to mention that.