File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -65,3 +65,34 @@ void loop() {
65
65
Running this examples gives the following output:
66
66
67
67
![ image] ( ../images/demo.gif )
68
+
69
+ ### Software Serial
70
+
71
+ You can send data to multiple Cereal monitors by creating more than one ` CerealStream ` .
72
+ ` CerealStream ` object take a destination stream it should write to.
73
+
74
+ Destination stream is any object of class that inherits from built-in ` Print ` class.
75
+
76
+ ``` cpp
77
+ #include " SoftwareSerial.h"
78
+ #include " Cereal.h"
79
+
80
+ int i = 0 ;
81
+
82
+ SoftwareSerial sSerial (3, 4);
83
+ CerealStream sCereal(sSerial);
84
+
85
+ void setup() {
86
+ Serial.begin(9600);
87
+ sSerial.begin(9600);
88
+ }
89
+
90
+ void loop() {
91
+ // Writes to HardwareSerial0
92
+ Cereal.variable("I", i++);
93
+
94
+ // Writes to SoftwareSerial RX(3)/TX(4)
95
+ sCereal.variable("I", i++);
96
+ }
97
+
98
+ ```
You can’t perform that action at this time.
0 commit comments