File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 19
19
# CS = digitalio.DigitalInOut(board.RFM9X_CS)
20
20
# RESET = digitalio.DigitalInOut(board.RFM9X_RST)
21
21
22
- # Define the onboard LED
23
- LED = digitalio .DigitalInOut (board .D13 )
24
- LED .direction = digitalio .Direction .OUTPUT
22
+ # Define the onboard LED
23
+ LED = digitalio .DigitalInOut (board .D13 )
24
+ LED .direction = digitalio .Direction .OUTPUT
25
25
26
26
# Initialize SPI bus.
27
27
spi = busio .SPI (board .SCK , MOSI = board .MOSI , MISO = board .MISO )
36
36
# high power radios like the RFM95 can go up to 23 dB:
37
37
rfm9x .tx_power = 23
38
38
39
- # Packet counter, incremented per tx
40
- packetNum = 0
41
-
42
39
# Send a packet. Note you can only send a packet up to 252 bytes in length.
43
40
# This is a limitation of the radio packet size, so if you need to send larger
44
41
# amounts of data you will need to break it into smaller send calls. Each send
53
50
print ('Waiting for packets...' )
54
51
55
52
while True :
56
-
57
53
packet = rfm9x .receive ()
58
54
# Optionally change the receive timeout from its default of 0.5 seconds:
59
55
#packet = rfm9x.receive(timeout=5.0)
60
56
# If no packet was received during the timeout then None is returned.
61
57
if packet is None :
58
+ # Packet has not been received
62
59
LED .value = False
63
60
print ('Received nothing! Listening again...' )
64
61
else :
You can’t perform that action at this time.
0 commit comments