We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e486aed commit 918cf51Copy full SHA for 918cf51
1 file changed
examples/X_NUCLEO_GNSS1A1_VirtualCOMPort/X_NUCLEO_GNSS1A1_VirtualCOMPort.ino
@@ -0,0 +1,34 @@
1
+volatile uint8_t fromPC[16];
2
+volatile uint8_t fromGNSS[16];
3
+volatile unsigned long idxPC = 0;
4
+volatile unsigned long idxGNSS = 0;
5
+
6
+#ifdef ARDUINO_ARCH_STM32
7
+HardwareSerial Serial1(PA10, PA9);
8
+#endif
9
10
+void setup() {
11
+ Serial.begin(115200);
12
+ Serial1.begin(115200);
13
+ pinMode(7, OUTPUT);
14
+ digitalWrite(7, LOW);
15
+ delay(1000);
16
+ digitalWrite(7,HIGH);
17
+ delay(50);
18
+}
19
20
21
+void loop() {
22
+ if(Serial.available()){
23
+ fromPC[idxPC]= Serial.read();
24
+ Serial1.write(fromPC[idxPC]);
25
+ idxPC++;
26
+ idxPC %= 16;
27
+ }
28
+ if(Serial1.available()){
29
+ fromGNSS[idxGNSS]= Serial1.read();
30
+ Serial.write(fromGNSS[idxGNSS]);
31
+ idxGNSS++;
32
+ idxGNSS %= 16;
33
34
0 commit comments