-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSGP7Juli.ino
45 lines (36 loc) · 1011 Bytes
/
SGP7Juli.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <SoftwareSerial.h>
SoftwareSerial mySerial(PA10, PA9); // RX, TX
SoftwareSerial mySerial2(PA3, PA2); // RX, TX
SoftwareSerial mySerial3(PB10, PB11); // RX, TX
void setup() {
// Inisialisasi mySerial
mySerial.begin(9600);
mySerial2.begin(9600);
mySerial3.begin(9600);
}
void loop() {
mySerial.listen();
if (mySerial.available() > 0 ) {
String receivedChar = mySerial.readString();
mySerial.print("Received: ");
mySerial.println(receivedChar);
}
delay(10);
mySerial2.listen();
if (mySerial2.available() > 0 ) {
String receivedChar = mySerial2.readString();
mySerial2.print("Received: ");
mySerial2.println(receivedChar);
}
delay(10);
mySerial3.listen();
if (mySerial3.available() > 0 ) {
String receivedChar = mySerial3.readString();
mySerial3.print("Received: ");
mySerial3.println(receivedChar);
}
mySerial.println("heloSerial");
mySerial2.println("heloSerial2");
mySerial3.println("heloSerial3");
delay(10);
}