Devices & Components
Arduino Uno Rev3
NeoPixel strip
Rubber/Plastic wheel
9V Battery Clip
Modulo Bluetooth HC05
25W L298N Dual HBridge
9V Battery Supply
100 RPM Dual Shaft BO Motor - Straight
Hardware & Tools
laser sheet cutting machine
Software & Tools
Arduino IDE
MIT App Inventor 2
Project description
Code
arduino code for bluetoth car
c
written by Ali for circuitdigest.com
1#include <SoftwareSerial.h> 2 3SoftwareSerial mySerial(10, 11); // RX, TX 4 5void setup() { 6 // Open serial communications and wait for port to open: 7 Serial.begin(9600); 8 mySerial.begin(38400); 9 10 while (!Serial) { 11 ; // wait for serial port to connect. Needed for native USB port only 12 } 13 14 Serial.println("Sending AT..."); 15 mySerial.write("AT"); 16 17 if (mySerial.available() > 0) { 18 Serial.write(mySerial.read()); 19 } 20 21 // set the data rate for the SoftwareSerial port 22 Serial.println("loop begins"); 23 LED_setup(); 24} 25 26char rcd = ' '; 27int spd = 100; 28unsigned long time_now = 0; 29 30void loop() { // run over and over 31 if (mySerial.available()) { 32 rcd = mySerial.read(); 33 Serial.write(rcd); 34 } 35}
Comments
Only logged in users can leave comments