PIR_MadMax/Sécurité/Application/Application.ino

65 行
無檔案結尾符
1.4 KiB
C++

/* #include <SoftwareSerial.h>
//Adress of HC-05: 98:D3:51:FF:08:5E
sudo rfcomm release 0
sudo rfcomm connect 0 98:D3:51:FF:08:5E 1
echo "H" | sudo tee /dev/rfcomm0
sudo screen /dev/rfcomm0 9600
Rien qui marche, un vrai problème. Linux arrive à parler avec la module, ou je me connecte bien avec le module.
Mais dès que j'essaye de retrouver le message ou string envoyé par l'environnement Linux, rien s'affiche dans le serial monitor
Faut rechercher plus, jsp. Parler avec Acco peut-etre. Faut que je regarde auusi sur un oscillo pour juste voir si quelque bits arrive ou quoi
#define RX 14 //D5
#define TX 12 //D6
SoftwareSerial mySer(RX,TX);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial){};
Serial.println("Testing here!");
mySer.begin(9600);
mySer.println("Testing 2!");
}
void loop() {
if(mySer.available()){
Serial.write(mySer.read());
}
if(Serial.available()){
mySer.write(Serial.read());
}
}
*/
#include <SoftwareSerial.h>
#define RX 14 // D5
#define TX 12 // D6
SoftwareSerial mySer(RX, TX);
void setup() {
Serial.begin(9600); // Serial Monitor
mySer.begin(9600); // HC-05
Serial.println("ESP8266 ready!");
}
void loop() {
// Bluetooth → Serial Monitor
while (mySer.available()) {
char c = mySer.read();
Serial.print(c);
}
// Serial Monitor → Bluetooth
while (Serial.available()) {
char c = Serial.read();
mySer.print(c);
}
}