![]() Then in the loop function, we checked that if the data is available or not or if the button on the android app is pressed or not. This output from the Arduino will be the input for the L293D motor controller IC. Then in the setup function, we declared all the pins as the output pins because we will give the output to the L293D motor controller from these pins. The flag variable initialized will make sure that the serial prints only once the state. The state variable we initialized is for storing the output that will come from the Bluetooth device. We initialized four pins, two are for controlling the first motor and the other two are for controlling the second motor. Serial.println("Both Motors Anti-clockwise") įirst of all, we initialized the pins in the code which are for controlling the motors. If you don’t know how to interface how to interface HC 06 BT module with Arduino check this: HC-05 Bluetooth module interfacing with ArduinoĬode of Bluetooth based dc motor speed and direction control int first_motor_pin1 = 11 By typing ‘0’, both the motors will stop to move. Now, when you will type ‘1’ there, then the left motor will start to move and when you will type ‘2’, then the right motor will start to move and similarly by typing ‘3’, the both the motors will turn clockwise and by typing ‘4’, both the motors will turn anticlockwise. After connecting it to the Bluetooth module, it will show you blue empty screen. After installing the APP, open it and from the options and connect it to the Bluetooth module. The HC-06 Bluetooth module works with the Arduino through the serial communication which means that the Arduino will send and receive the data through the Serial.To send the information from the App, we first need to install it. Working of Bluetooth based dc motor speed and direction control ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |