I am trying to connect to an HC-05 but it just does nothing when i try to connect

I am trying to connect to an HC-05 module but when i select the hc-05 it says its connected but it didn't connect, and here's what the code looks like:


i always when i switch the screen just get error 515.

Don't switch the screen to not loose the connection

Also remember to switch screens correctly

Taifun

yes, dont worry ive got the screen switching down, but are you saying that if i switch screens it will break the bluetooth connection? here is the new code also on screen 1:


red is detecting bluetooth input
blue is connecting (again).

red is the after picking stuff

Yes
Taifun

What does the HC-05 send?

I don't see you asking it for text (or bytes or anything) in Screen1.

Upload the HC-05 sketch?

ahhhhhhhh, ok. so i modified the code, in the last post, and it works!!!!! it is a little broken still, apperently the HC-05 thing is constantly sending data or it has something to do with the clock thing. either way, the bluetooth works! the HC-05 blinks slowly when paired. will have to fix the constant push of button issue.

as for ABG, the HC-05 actually sends data when the button is not being pressed,
just found that out by looking at the code, and it doesn't really matter what is being sent as long as it knows that something is getting pressed. i think.

here's my sketch:

void setup() {
  Serial.begin(9600); // Initialize hardware serial for Bluetooth communication
  pinMode(2, INPUT_PULLUP); // Set Pin 2 as input with internal pull-up resistor
}

void loop() {
  if (digitalRead(2) == HIGH) { // Check if the button is pressed (LOW because of pull-up)
    Serial.println("B"); // Send the character 'B' (or any character) followed by a newline
    delay(200); // Debounce delay
  }
}

also, once i press the pedal, it just keeps counting without stopping. i will take a better look later at the code.