Hi
Wondered if anyone had a few moments to help a beginner de bug a code I got from GitHub? Looking to connect to the GoBLE app with Arduino Uno but getting an error at line 19 and also line 23 comes up red.
Error message is saying "GoBLE does not have a name". I checked and I did include the reference at the start, any other ideas what I can try?
Thank you so very very much
Arduino Sketch Code:
#include <Servo.h>
#include "GoBLE.h"
#include "Metro.h"
Metro servoMove(50);
Servo myservoLF;
Servo myservoLR;
Servo myservoRF;
Servo myservoRR;
int centre = 82;
int minSpeed = 5;
int fullSpeed = 30;
int attached = 0;
int pinLED = 13;
GoBLE Goble(Serial);// init the bluetooth Serial port
int joystickX, joystickY;
int buttonState[7];
int speedL, speedR;
void attach () {
attached = 1;
myservoLF.attach(5);
myservoLR.attach(2);
myservoRF.attach(4);
myservoRR.attach(3);
digitalWrite(pinLED, HIGH);
}
void detach() {
attached = 0;
myservoLF.write(center);
myservoLR.write(center);
myservoRF.write(center);
myservoRR.write(center);
myservoLF.detach();
myservoLR.detach();
myservoRF.detach();
myservoRR.detach();
digitalWrite(pinLED, LOW);
}
void setup()}
Goble.begin();// init Goble and default baudrate is9600bps
Serial.begin(115200);//
pinMode(pinLED, OUTPUT);
}
void loop(){
if(Goble.available()){
joystickX=Goble.readJoystickY() - 128;
joystickY=Goble.readJoystickX() - 128;
buttonState[Switch_UP] =Goble.readSwitchUP();
buttonState[Switch_LEFT] =Goble.readSwitchLeft();
buttonState[Switch_RIGHT] =Goble.readSwitchRight();
buttonState[Switch_DOWN] =Goble.readSwitchDown();
buttonState[Switch_SELECT] =Goble.readSwitchSelect();
buttonState[Switch_START] =Goble.readSwitchStart();
speedL = (joystickY + joystickX) / (225 / fullSpeed);
speedR = (JoystickY - joystickX) / (225 / fullSpeed);
}
if (abs(speedL) < minSpeed) {
speedL = 0;
}
if (abs(speedR) < minSpeed) {
speedR = 0;
}
if (servoMove.check()) {
if (speedL == 0 && speedR == 0) {
if (attached) {
detach();
}
} else {
if(!attached) {
attach();
}
myservoLF.write(center - speedL);
myservoLR.write(center - speedL);
myservoRF.write(center + speedR);
myservoRR.write(center + speedR);
}
}
}