|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
-
-
- #include <SoftwareSerial.h>
-
- SoftwareSerial portOne(10,11);
-
-
-
- SoftwareSerial portTwo(8,9);
-
- void setup()
- {
-
- Serial.begin(9600);
- while (!Serial) {
- ;
- }
-
-
-
- portOne.begin(9600);
- portTwo.begin(9600);
- }
-
- void loop()
- {
-
-
- portOne.listen();
- Serial.println("Data from port one:");
-
-
- while (portOne.available() > 0) {
- char inByte = portOne.read();
- Serial.write(inByte);
- }
-
-
- Serial.println();
-
-
- portTwo.listen();
-
-
- Serial.println("Data from port two:");
- while (portTwo.available() > 0) {
- char inByte = portTwo.read();
- Serial.write(inByte);
- }
-
-
- Serial.println();
- }
-
-
-
-
-
-
|