Hi all. I just recently purchased an Arduino Starter Kit. I have no experience, but I am trying to learn my way with all the topics/videos I can find.
My first project was intended to be an object avoiding robot, but I could not get the motors to work. So I decided to take a step back and just work on powering the DC Motor that came with the Kit before moving on to anything more. However, even with this project I am facing a lot of difficulties. Again, this is my first project so sorry if I made some blatantly obvious mistake, I'm just trying to learn my way.
Attached is the image of my current schematic and the code I'm using to run the motor. I'm using a 2222A transistor, a 220 ohm resistor, and a 1N4007 Diode.
I have read through countless articles and watched way too many videos, so any help you could give would be much appreciated.
Code:
int motorPin = 3;
void setup() {
}
void loop() {
digitalWrite(motorPin, HIGH);
}