Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Bluetooth (BLE) data transfer

Status
Not open for further replies.

NathanT

New Member
Hello everybody! I have a problem with bluetooth data transfer. I found project of smart glove on instructables made by Matlek. But I want to receive gesture "Stop" on ESP32 by getting high signal on pin D7 on Nano 33 BLE Sense. I asked about this the author of project, but he don't know how to do that...

The author allowed to publish the Arduino code on github.

This is original code for Nano 33 BLE Sense:

https://github.com/NathanTur/Smart-glove/blob/main/Smartglove_BLE_IMU-Classifier.ino

This is original code for ESP32:

https://github.com/NathanTur/Smart-glove/blob/main/Smartglove_BLE_LED-matrix.ino

First of all, I connected button for simulating of getting high signal on pin D7 on Nano 33 BLE Sense.
Code:
int BUTTON_PIN = 7;

int LED = 24;

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
}

void loop() {
  if (digitalRead(BUTTON_PIN) == HIGH) {
    digitalWrite(LED, LOW);
    Serial.println("Button pressed");
  }

  else {
    digitalWrite(LED, HIGH);
    Serial.println("Button released");
  }
}

All is working good and I see information in COM port:

I made branche "Experiment" on github with changes in original code:

https://github.com/NathanTur/Smart-glove/tree/Experiment

You can see differences in code for Nano 33 BLE Sense here (ESP32 code is unmodified):

https://github.com/NathanTur/Smart-glove/pull/1/files

As you can see, I commented out lines to transmitting data for ESP32 (//ledCharacteristic.writeValue) at first time.

But I can't see any data in COM port, while I'm pressing on button. So, what I'm doing wrong? Please, give me a hint!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top