Skip to content

Commit 15af2e4

Browse files
committed
add sketch used for testing
1 parent 43451a3 commit 15af2e4

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/test_ws.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_list(socketio):
2020
assert any("Ports" in i for i in message)
2121
assert any("Network" in i for i in message)
2222

23-
# NOTE run the following tests on linux with a board connected to the PC and with this sketch on it: https://gist.github.com/Protoneer/96db95bfb87c3befe46e
23+
# NOTE run the following tests on linux with a board connected to the PC and with the sketch found in test/testdata/SerialEcho.ino on it
2424
@pytest.mark.skipif(
2525
running_on_ci(),
2626
reason="VMs have no serial ports",

test/testdata/SerialEcho.ino

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
int incomingByte = 0; // for incoming serial data
2+
3+
void setup() {
4+
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
5+
}
6+
7+
void loop() {
8+
// send data only when you receive data:
9+
if (Serial.available() > 0) {
10+
11+
// read the incoming byte:
12+
incomingByte = Serial.read();
13+
14+
// say what you got:
15+
Serial.print((char)incomingByte);
16+
}
17+
18+
}

0 commit comments

Comments
 (0)