Activity 3: Controlling 2 DC motors using L298N driver and Arduino
Components required:- Same as Activity 1,2 (with one additional DC motor).
Observation:
In this activity, we saw that both the motors run in the same direction and speed together.
Steps:-
1. Upload the code
2. Connect the first motor to the left side of the driver (Port A).
3. Connect the second motor to the right side of the driver (Port B).
4. Connect 6pin molex connector to L298N driver.
5. Connect 6pin molex connector to Shield L298N port.
6. Connect the 12V power cable to the Power port of the shield (2 Pin).
7. Give power supply to Arduino by 12 V Adaptor.
LCD (16X2):
LCD Stands for Liquid Crystal Display. It is used to show output processed by a microcontroller. The 16x2
LCD is named so because it has a grid of 16 columns and 2 rows.
Some functions for working with LCD are given below-
Icd.setCursor( );
Syntax:
Icd.setCursor(Column, Row);
It specifies the position of the cursor. Column & row starts from 0 (zero). So the position of the first
character is (0,0) & the position of the last character is (15,1). To write character "A" at given position on
display we will write -
lcd.setCursor (11,1);
lcd.print("A");
lcd.print( ); This function is used to write content on a specified location set by setCursor().