Hi all.
Apologies for the total newbie question. We all have to start somewhere though?
I'm trying to update the Arduino code for the GoBLE Bluetooth controller app so that I can run it on a Pro Micro. My issue is that it all works fine when using an UNO but when I try to update the code to access Serial1 for the Micro I don't get any readings on the serial monitor.
I'm pretty much just blindly trying things to see if they work. If anyone has the time to help me with this I would greatly appreciate it as I'm trying to make a Bluetooth controlled car with my boy.
I'm not asking for it to be done for me, I would like to know the reasoning and process to understand how to implement this and to further understand how to integrate Serial1 into existing code.
This is the test code for the app...
#include <Metro.h>
#include "GoBLE.h"
int joystickX, joystickY;
int buttonState[7];
void setup(){
Goble.begin();
Serial.begin(115200);
}
void loop() {
if(Goble.available()){
joystickX = Goble.readJoystickX();
joystickY = Goble.readJoystickY();
buttonState[SWITCH_UP] = Goble.readSwitchUp();
buttonState[SWITCH_DOWN] = Goble.readSwitchDown();
buttonState[SWITCH_LEFT] = Goble.readSwitchLeft();
buttonState[SWITCH_RIGHT] = Goble.readSwitchRight();
buttonState[SWITCH_SELECT] = Goble.readSwitchSelect();
buttonState[SWITCH_START] = Goble.readSwitchStart();
Serial.print("Joystick Value: ");
Serial.print(joystickX);
Serial.print(" ");
Serial.println(joystickY);
for (int i = 1; i < 7; i++) {
Serial.print("Button ID: ");
Serial.print(i);
Serial.print("\t State: ");
if (buttonState == PRESSED) Serial.println("Pressed!");
_ if (buttonState == RELEASED) Serial.println("Released!");_
* }*
* }*
}
I've tried adding Serial1.begin (115200) to the setup and If (Serial1.available()) to the loop before the If (Goble.available()) command. This made the information scroll in the serial monitor when I pushed any button on the app but the values didn't change, they all remained at their defaults.
I have managed to get Hex readings in cooltemp after writing a basic Serial1.print sketch. That confirmed I have the hardware hooked up and configured correctly. I just need to figure out how to modify the code.
Again, thank you for your patience as I'm sure this is an obvious thing to experienced programmers but it's escaping me and I can't seem to find any advice for this in searching forums/google.