Skip to content

Commit

Permalink
bytearray to String with str() in Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
joernesdohr committed Nov 22, 2015
1 parent 4601267 commit 814c5e0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion RPi/pyRF24Network/examples/helloworld_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
network.update()
while network.available():
header, payload = network.read(8)
ms, number = unpack('<LL', payload)
ms, number = unpack('<LL', str(payload))
print 'Received payload # ', number, ' at ', ms, ' from ', oct(header.from_node)
time.sleep(1)

2 changes: 1 addition & 1 deletion RPi/pyRF24Network/examples/helloworld_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if ( now - last_sent >= interval ):
last_sent = now
print 'Sending ..',
payload = pack('<LL', millis(), packets_sent )
payload = pack('<LL', packets_sent, packets_sent )
packets_sent += 1
ok = network.write(RF24NetworkHeader(other_node), payload)
if ok:
Expand Down
6 changes: 3 additions & 3 deletions RPi/pyRF24Network/examples/helloworld_tx.python3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
millis = lambda: int(round(time.time() * 1000))

radio.begin()
time.sleep(0.1);
time.sleep(1);
network.begin(90, this_node) # channel 90
radio.printDetails()
packets_sent = 0
last_sent = 0
while 1:
network.update()
#network.update()
now = millis() # If it's time to send a message, send it!
if ( now - last_sent >= interval ):
last_sent = now
print('Sending ..')
payload = pack('<LL', millis(), packets_sent )
payload = pack('<LL', packets_sent, packets_sent )
packets_sent += 1
ok = network.write(RF24NetworkHeader(other_node), payload)
if ok:
Expand Down

0 comments on commit 814c5e0

Please sign in to comment.