Created
February 6, 2014 15:41
-
-
Save JerzySpendel/8846623 to your computer and use it in GitHub Desktop.
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
import requests | |
import pyserial | |
import time | |
def normalizeData(text): | |
lines = [] | |
for line in text.split('\n'): | |
lines.append(line) | |
data = '' | |
for line in lines: | |
data += line | |
return data | |
data = requests.get('http://www.modelmania.com.pl/test_drukarka.txt').text | |
data = normalizeData(data) | |
dev = serial.Serial('/dev/ttyUSB0', 19200, timeout=1) | |
dev.write("$05") | |
print(dev.read(1024**2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment