I am currently using the arduino Uno connected with L298N(green pcb) connected to a dc motor rated 12V. I provided dedicated 12v power supply to the dc motor and the arduino board's power is supplied by usb connected to my pc. I connected Pin 9 of arduino uno to 'ENA' on L298N , Pin 7 & 8 (UNO) to 'INA' & 'INB' of L298N. Connected '-' polarity of Motor power supply to GND of L298N, while also connecting the 'GND' of L298N to the GND of Arduino UNO. Last but not least, connecting the 'OUT B'to the dc motor. This is the picture of how L298N(green) look like https://sea.banggood.com/Green-Board-L298N-DC-Motor-Driver-Board-Stepper-Motor-p-974549.html?cur_warehouse=CN
Can i check why my motor isn't running? Thanks in advance.
char data = 0;
int enB = 9;
int InC = 8;
int InD = 7;
void setup()
{
Serial.begin(9600);
Serial.println("Motor test !");
pinMode(enB, OUTPUT);
pinMode(InC, OUTPUT);
pinMode(InD, OUTPUT);
}
void loop()
{Serial.println("Entered loop, should start moving now !");
digitalWrite(InC, HIGH);
digitalWrite(InD, LOW);
digitalWrite(enB, HIGH);
analogWrite(enB, 255);
}