Hi,
Currently have two parallel motors connected to digital pin 9 on UNO. Works perfectly, have the same electrical configuration, swapped the board to a 101, same connections, motor doesn't work. Have tried on a number of digital pwm pins (I'm controlling via a MOSFET so I can alter the speed).
Any ideas as to why it doesn't work? Is the code slightly different for the 101 to control motors?
#include <Servo.h>
Servo myservo;
int pos = 50;
const int motorPin = 9;
void setup() {
// put your setup code here, to run once:
myservo.attach(5);
pinMode(motorPin, OUTPUT);
}
void loop()
{
digitalWrite (motorPin, HIGH);
for (pos = 50; pos <= 120; pos += 1){
myservo.write(pos);
delay(30);
}
for (pos = 120; pos >= 50; pos -= 1){
myservo.write(pos);
delay(30);
}
}