I am using the hm10 ble module with the metro mini.
metro mini: Pinouts | Adafruit Metro Mini | Adafruit Learning System
hm10 ble: HM-10 Bluetooth 4 BLE Modules | Martyn Currey
I had it working when I was using an arduino nano. I am curious why the same functional circuit and same code does not work with the metro mini.
I confirmed the hm10 is powered at ~5V I used a voltage divider for the rx and tx using software serial to convert the 5v signal to 3.3v. I am using pin 4 and 5 on the metro mini. I have tried setting the baud rate to a few different values.
The phone app I created is able to connect to the hm10, but the data doesnt flow through (I dont see the print to the monitor from the code).
All of it was working when using the arduino nano. I believe the issue is related to the rx/tx pins and possibly the baud rate but im not sure whats missing.
The code Used on the metro mini (same as arduino nano):
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4,5); // RX, TX
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
// mySerial.begin(57600); //required when using the hm-10 with an arduino nano
mySerial.listen();
}
void loop() {
// read the value from the sensor:
if (mySerial.available()){
Serial.print("Received data: ");
while (mySerial.available()) {
Serial.write(mySerial.read());
}
Serial.println("");
}
}