Skip to content

Commit

Permalink
CW mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Merck committed Apr 23, 2016
1 parent ec75b52 commit fbfecae
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cw.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __init__(self,_serial_port,_dev_addr):
# timeout for write
self._ser.writeTimeout = 0

#print "Resetting LoRa Tranceiver..."
print "Resetting LoRa Tranceiver..."
self.write_command('sys reset',False)
#print "Configuring Tranceiver..."
print "Configuring Tranceiver..."
self.write_command('radio set mod lora')
self.write_command('mac pause')

Expand All @@ -60,7 +60,7 @@ def write(self, str):
self._ser.write(str + '\r\n')
return self.read()

def write_command(self, config_str, check_resp=False):
def write_command(self, config_str, check_resp=True):
'''
writes out a command
'''
Expand Down Expand Up @@ -103,19 +103,27 @@ def receive_message(self):
while True:
print "Sending V..."
loramote.write('radio cw on')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw off')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw on')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw off')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw on')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw off')
print "Read: ", loramote.read()
time.sleep(0.1)
loramote.write('radio cw on')
print "Read: ", loramote.read()
time.sleep(2)
loramote.write('radio cw off')
print "Read: ", loramote.read()
time.sleep(0.5)

0 comments on commit fbfecae

Please sign in to comment.