Compare commits
No commits in common. "209e15d41f05f30e2ed0219475bb752a6133c084" and "2ee6bbef907d97d87e9236b09e2e34810a95942b" have entirely different histories.
209e15d41f
...
2ee6bbef90
|
@ -5,30 +5,18 @@ from gps import *
|
||||||
from smbus import SMBus
|
from smbus import SMBus
|
||||||
import time
|
import time
|
||||||
|
|
||||||
addr = 0x4 # bus address
|
addr = 0x8 # bus address
|
||||||
bus = SMBus(1) # indicates /dev/ic2-1
|
bus = SMBus(1) # indicates /dev/ic2-1
|
||||||
|
|
||||||
numb = 1
|
numb = 1
|
||||||
|
|
||||||
def writeData(value):
|
|
||||||
byteValue = StringToBytes(value)
|
|
||||||
bus.write_i2c_block_data(addr,0x00,byteValue) #first byte is 0=command byte.. just is.
|
|
||||||
return -1
|
|
||||||
|
|
||||||
|
|
||||||
def StringToBytes(val):
|
|
||||||
retVal = []
|
|
||||||
for c in val:
|
|
||||||
retVal.append(ord(c))
|
|
||||||
return retVal
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for _x in range (0, 2):
|
for _x in range (0, 2):
|
||||||
for i in range(78, 130):
|
for i in range(70, 130):
|
||||||
writeData("WIPE-" + str(i))
|
bus.write_byte(addr, i)
|
||||||
time.sleep(0.02)
|
time.sleep(0.02)
|
||||||
for i in range(130, 78, -1):
|
for i in range(130, 70, -1):
|
||||||
writeData("WIPE-" + str(i))
|
bus.write_byte(addr, i)
|
||||||
time.sleep(0.02)
|
time.sleep(0.02)
|
||||||
except OSError:
|
except OSError:
|
||||||
print("Could not speak to ardujmemo")
|
print("Could not speak to ardujmemo")
|
||||||
|
|
Loading…
Reference in New Issue