-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathscroll.py
43 lines (28 loc) · 881 Bytes
/
scroll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
# Author: Nick Choi
import wmi
import os
import psutil
from time import strftime, time
import urllib
import socket
from Ergo_Infinity_Display import *
lcd = [[0 for x in range(32)] for x in range(128)]
w = wmi.WMI(namespace='root\\wmi')
hostname = socket.gethostname()
test = "test string to scroll"
if __name__ == '__main__':
ser = serial.Serial('COM3', 115200, timeout=0.5) # Change to (Serial port - 1) on Windows.
ser.close()
ser.open()
# Get external IP once (Not ideal....)
ip = urllib.urlopen('http://whatismyip.org').read() # External IP, This may need to be fixed as website changes
p = ip.find("font-weight: 600;")
ip = ip[p + 19:p + 34].strip('</span')
try:
xs=128
tx=0
revert(ser)
except KeyboardInterrupt: # Press Ctrl + C to exit
print 'Exit'
ser.close()