#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo;
int bluetoothTx = 10;
int bluetoothRx = 11;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
[
myservo.attach(9);
//Setup usb serial connection to computer
Serial.begin(9600);
//Set usb Bluetooth serial connection to andriod
bluetooth.begin(9600);
}
void loop()
{
//Read from bluetooth and write to usb serial
if(bluetooth.available()>0)
{
int toSend = bluetooth.read();
Serial.println(toSend);
myservo.write(toSend);
}
See something wrong?
void setup()
[
.
.
.
}
loop() is also missing a close brace.
You guys were right thank you very much. Stupid mistakes from building apps for long, need to take more brakes in between coding.