Hi,
I tried to connect a motor with a transistor to the arduino. The C pin of the transistor I connected to the 3v3 pin the B pin to Pin 11 and the E pin I connected to the motor. the other Motor-pin I connected to Ground.
Now I send PWM signals to the B pin of the transistor. The motor works. put during the moter turns, the serial port doesn´t work. That´s my code:
void setup(){
Serial.begin(9600);
Serial.print("Ready");
}
void loop(){
static int v = 0;
if (Serial.available()){
char ch = Serial.read();
switch (ch){
case '0'...'9':
v = v * 10 + ch - '0';
analogWrite(11,v);
delay(3000);
analogWrite(11,0);
break;
}
}
}
after the motor stops, I can´t send a second command to let the motor tun again. :question :question :question
please answer
I mostly send "120s" or "180s"
ealy