add error msgs to pi radio testing examples

This commit is contained in:
brentru 2019-12-10 09:46:04 -05:00
parent 40056f820f
commit 06c9891d12
2 changed files with 4 additions and 2 deletions

View file

@ -54,9 +54,10 @@ while True:
try:
rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, 915.0)
display.text('RFM69: Detected', 0, 0, 1)
except RuntimeError:
except RuntimeError as error:
# Thrown on version mismatch
display.text('RFM69: ERROR', 0, 0, 1)
print('RFM69 Error: ', error)
# Check buttons
if not btnA.value:

View file

@ -53,9 +53,10 @@ while True:
try:
rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, 915.0)
display.text('RFM9x: Detected', 0, 0, 1)
except RuntimeError:
except RuntimeError as error:
# Thrown on version mismatch
display.text('RFM9x: ERROR', 0, 0, 1)
print('RFM9x Error: ', error)
# Check buttons
if not btnA.value: