My dad bought the sparkfun kit 15631 for me and I’m on Circuit number 5A, Motor Basics. I made all the necessary pin attachments and checked it 3 times. When I go to the Arduino IDE and run the code, it says:
Enter motor speed (0-255)...
Motor Speed: 100
Motor Speed: 0
Motor Speed: 50
Motor Speed: 0
Basically, whenever I enter a number in the terminal it goes straight back to 0, and my motor doesn’t spin. And it doesn’t matter which direction I move the switch, it does this for either direction. I put a piece of tape on the axis. I tried changing the 0 in
if (Serial.available() > 0) {
to a 1, and basically it stops immediately going back to 0 and just says motor speed 100 motor speed 50, but the motor still doesn’t run. What is the issue, and why was my code behaving that way to begin with? thanks
Also, try a motor speed of 255. The lower speeds sometimes won’t provide enough current to the motor to get it started turning but you can usually use them after the motor is spinning.
TS-Brandon:
Can you provide a picture of your setup? Also did you copy/paste the code, re-wrote it line by line, or used code provided online?
it doesn’t seem like I can upload pictures of any file extension, when I try it just says “HTTP error” and stops its progress… Can I email them to you?