MicroPython on the S1 lets you quickly prototype and test your algorithms without having to get deep into C development. You can easily test FPGA binaries, read or write data, and control all module features over the air.
No programmer needed
MicroPython also functions as an excellent network stack. Allowing you to interface to a mobile app, or Bluetooth gateway, using simple strings.
from machine import RTC from machine import FPGA FPGA.run() # Boot the FPGA application processedData = bytearray(100) # Data from the FPGA will be stored here while True: FPGA.read(processData) # Read 100 bytes over SPI processedData # Print out the data RTC.sleep_ms(1000) # Repeat again every second
MicroPython works great on all of our S1 products.
Download the latest
.hexrelease from here 📁
Make sure you have the nRF command line tools installed
Flash the binary using the command
nrfjprog --program micropython-s1-*.hex --chiperase -f nrf52 --verify -r
Access MicroPython wirelessly using our Web REPL
Click Connect and you’ll see your S1 device appear. Select it and click Pair
Press Ctrl-B to enter the friendly REPL mode
All of the S1 related functions are located inside the
machinemodule. Import it using the command
To see what’s contained inside
machine, you can use the
You can import any class contained within
machine, and use them directly without having to specify
machinebefore the class name
from machine import Pin myPin = Pin(Pin.PIN_A1, pull=Pin.PULL_DOWN) myPin() # Reads the pin value
You can also call help on these inner classes to see the functions contained within
from machine import Pin help(Pin)
Spotted something? Feel free to report any bugs you find, or suggest improvements. We’re always willing to improve things.
That’s it! For the full list of classes and functions, check out the pages below. Happy tinkering!