Notifications
Clear all

Bluetooth (BLE) data transfer

2 Posts
2 Users
1 Likes
1,118 Views
Nathan T
(@nathan-t)
Member
Joined: 2 years ago
Posts: 1
Topic starter  

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.

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!


   
Quote
(@davee)
Member
Joined: 3 years ago
Posts: 1671
 

Hi @nathan-t,

 Sorry, but I think the question you are asking requires a lot of time, effort and resources to sort out, including access to BLE modules which I haven't seen mentioned very often.

I think you need to break your problem into smaller parts, and get each part working ..by parts, I am including software 'parts', as well as hardware parts.

I haven't looked into the code refrences, but clearly you have BLE comms, tensorlite gesture, LED drivers, and so on, all of which will have their own pecularities to figure out. Trying to fix and understand all of them from scratch at the same time is likely to be doomed. So pick a small part and get that to work in isolation...

I think you have made a modest start with the small fragment of code above.  That presumably works the way you expect. So build on that with the next small increments of functionality.

I suggest you need some kind of software/system diagram that explains all of the parts/functions needed, so it is possible for anyone else to understand how it is supposed to work. Then progressively implement each part.

If you get stuck, then start a new question showing what you have and why that differs from what you need. But make sure it is a 'small and easily understood' aim and code fragment size.

Good luck ... I hope you enjoy the challenge. Dave


   
Inst-Tech reacted
ReplyQuote