Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 29cf16b

Browse files
quickhack: improved stability, had lockups befor this change - now the python module sends out a command that causes the loop to start again - including sending a new request
1 parent abae764 commit 29cf16b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎arduino/arduino.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Arduino(object):
88

99
def __init__(self, port, baudrate=115200):
1010
self.serial = serial.Serial(port, baudrate)
11+
self.serial.write('99')
1112

1213
def __str__(self):
1314
return "Arduino is on port %s at %d baudrate" %(self.serial.port, self.serial.baudrate)

‎prototype.pde‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ void loop() {
3434
case 4 :
3535
//read analog value
3636
Serial.println(analogRead(readData()));
37+
case 99:
38+
//just dummy to cancel the current read, needed to prevent lock when the PC side
39+
//dropped the "w" that we sent
40+
break;
3741
}
3842
}
3943

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /