Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fbf49e
commit 390efbf
Showing
6 changed files
with
195 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
dist | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from super7 import Super7, BaudRates | ||
import sys | ||
import time | ||
|
||
bauds = [ | ||
(BaudRates.BAUD_2400, '2400'), | ||
(BaudRates.BAUD_4800, '4800'), | ||
(BaudRates.BAUD_9600, '9600'), | ||
(BaudRates.BAUD_14400, '14400'), | ||
(BaudRates.BAUD_19200, '19200'), | ||
(BaudRates.BAUD_38400, '38400'), | ||
(BaudRates.BAUD_57600, '57600'), | ||
(BaudRates.BAUD_76800, '76800') | ||
] | ||
|
||
for rate in bauds: | ||
print(rate[1]) | ||
s7 = Super7(sys.argv[1], baudrate=rate[0]) | ||
s7.factory_reset() | ||
s7._com.close() | ||
|
||
s7 = Super7(sys.argv[1], baudrate=BaudRates.BAUD_9600) | ||
s7.write("S7 Reset") | ||
# s7.write("do reset") | ||
# time.sleep(1) | ||
# s7.factory_reset() | ||
# time.sleep(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters