I have a rc car project working on, using uno+motor shield.
All motors are connected, only issue is bluetooth and programming... i think
The shield covers up all the pins so I'm not sure how to add the bluetooth module and would like some general knowledge for programming, i had a basic test code but i dont know how to add the bluetooth
#include <AFMotor.h>
AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");
motor1.setSpeed(225); // set the speed to 200/255
motor2.setSpeed(225);
motor3.setSpeed(225);
motor4.setSpeed(225);
}
void loop() {
Serial.print("foward");
motor1.run(FORWARD); // turn it on going forward
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(1000);
Serial.print("back");
motor1.run(BACKWARD); // the other way
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(1000);
Serial.print("left");
motor1.run(FORWARD); // turn it on going left
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(FORWARD);
delay(1000);
Serial.print("right");
motor1.run(RELEASE); // turn it on going right
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(RELEASE);
delay(1000);
Serial.print("tack");
motor1.run(RELEASE); // stopped
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
delay(1000);
}
}
void loop() {
// put your main code here, to run repeatedly:
}