Hello, I'm fairly new to arduino but I'm learning it because of school projects. We are trying to communicate our phone to an RN4020 bluetooth module. More specifically one on top of a mikroBUS adapter.
Link beneath.
Here is also the link of the user's guide for the RN4020
I've been struggling for a good week now and can't seem to find any good/clear examples of this module or adapter on the internet. I've been trying several programs to try and send commands to my RN4020 but it just isn't working. I myself don't have much knowledge of the topic and I really don't know what to do.
The module is awake but I can't find it with my phone, thus I tought that the module itself was in the wrong GAP mode, (command instead of peripheral). But changing the GAP mode seems harder then expected. I'm thinking it's something very simple and I'm just overlooking it, but I don't know enough about bluetooth 4.0 and arduino to solve the problem.
The core of the problem is the communication between my PC and bluetooth module( I don't get answers when I put a command in the Serial Monitor).
Here is the code I have so far:
#include <SoftwareSerial.h>
const byte rxPin = 0;
const byte txPin = 1;
const byte cmdPin = 3;
SoftwareSerial mySerial (rxPin, txPin);
void setup(){
delay(5000);
mySerial.begin(115200);
Serial.begin(115200);
pinMode(3, OUTPUT);
digitalWrite(cmdPin, HIGH);
}
void loop(){
char c = mySerial.read();
delay(500);
Serial.print(c);
}