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);
}
}
IRF3708PBF works pretty well at 3.3v on gate. It's not rated for that, but per the graphs in the datasheet, it's pretty good at 3.3v - it's the best through-hole MOSFET I was able to find for 3.3v gate voltages and a decent amount of current.
So I've swapped the transistor around, as I also had a couple of IRF520NPBF, and it seems to work so I'll use it for the while. I'll look into the IRF3708PBF!