-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the driver wait for the nRF to be ready on boot
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import machine | ||
|
||
spi = machine.SPI('Y', baudrate=10000000) | ||
|
||
|
||
import ssd1306 | ||
disp_slave_select = machine.Pin('Y5', machine.Pin.OUT) | ||
disp_slave_select.value(1) | ||
d = ssd1306.SSD1306_SPI(128, 64, spi, machine.Pin('X11'), machine.Pin('X22'), disp_slave_select) | ||
|
||
import quokka_radio | ||
nrf_slave_select = machine.Pin('Y4', machine.Pin.OUT) | ||
nrf_slave_select.value(1) | ||
r = quokka_radio.Radio(nrf_slave_select, spi) | ||
|
||
d.fill(1) | ||
d.text('radio', 5, 5, 0) | ||
d.show() | ||
|
||
r.enable() | ||
print('version:', r.version()) | ||
print('version:', r.version()) | ||
|
||
import pyb | ||
pyb.LED(2).on() | ||
|
||
r.set_channel(22) | ||
|
||
while True: | ||
msg = r.receive() | ||
if msg: | ||
d.fill(1) | ||
d.text(msg, 5, 5, 0) | ||
d.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters