Code for voice controlled car T4TECHZ
#include <SoftwareSerial.h> SoftwareSerial BT(0, 1); //TX, RX respetively String readvoice; int LED1 = A0; //define LED 1 pin int LED2 = A1; //define LED 2 pin int LMP=3; int LMN=4; int RMP=5; int RMN=6; long duration, distance, duration2, distance2; void setup() { BT.begin(9600); Serial.begin(9600); pinMode(LMP, OUTPUT); pinMode(LMN, OUTPUT); pinMode(RMP, OUTPUT); pinMode(RMN, OUTPUT); } //-----------------------------------------------------------------------// void loop() { while (BT.available()){ //Check if there is an available byte to read delay(10); //Delay added to make thing stable char c = BT.read(); //Conduct a serial read readvoice += c; //build the string- "forward", "reverse", "left" and "right" } if(readvoice == "*forward#") { digitalWrite(LMP, HIGH); digitalWrite (LMN, HIGH); digitalWrite(RMP,LOW); ...