Introducing the CircuitPython on Wio Terminal

Previously, we have added a wiki how to use Seeeduino XIAO with CircuitPython (Check here). And today we are happy to announce that Wio Terminal is also officially supported by CircuitPython!

Merged Wio Terminal’s PR

What is CircuitPython?

CircuitPython is a programming language designed to simplify experimenting and learning to program on low-cost microcontroller boards. It makes getting started easier than ever with no upfront desktop downloads needed.

Getting Started with Wio Terminal

  • CircuitPyhton

To get CircuitPython running with Wio Terminal, simply visit the CircuitPython Download page (currently not up yet) and download the .uf2 firmware and load it to the board. 

Or you can also download the source code from CircuitPython’s Github and follow the official tutorial to build the firmware from scratch.

Once you have the .uf2 file, enter the bootloader mode of Wio Terminal by sliding the power switch twice very quickly.

You should be able to see a Arduino USB drive appeared in your PC. Simply drag the .uf2 into the USB drive and it will load CircuitPython Firmware into Wio Terminal!

Benchmark

Let’s do a simple benchmark test on CircuitPython running on Wio Terminal. 

  • CircuitPython Benchmark
  • CircuitPython Benchmark Code:
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import storage
import sys
  
#circuit python benchmark
print("\n---- CircuitPython Benchmark ----")
print("Verison: " + str(sys.implementation[1][0]) + "-" + str(sys.implementation[1][1])+"-"+str(sys.implementation[1][2]))
 
circuitpythonversion = str(sys.implementation[1][0]) + "-" + str(sys.implementation[1][1])+"-"+str(sys.implementation[1][2])
  
#GPIO
 
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
start = time.monotonic()
for i in range(0,100000):
    led.value = True
    led.value = False
print("GPIO on/off benchmark: ", time.monotonic()-start)
 
 
out = 0
start = time.monotonic()
for i in range(0,100000):
    out= out+i+i
print("Integer sum: ", time.monotonic()-start)
 
out = 0
start = time.monotonic()
for i in range(0,100000):
    out= out + i*i
print("Integer multi: ", time.monotonic()-start)
 
out=0.1
start = time.monotonic()
for i in range(0,100000):
    out=out+i+0.1
print("Float sum: ", time.monotonic()-start)
 
out=0.1
start = time.monotonic()
for i in range(0,100000):
    out=i*0.1*out
print("Float multi: ", time.monotonic()-start)
 
out=0.1
start = time.monotonic()
for i in range(0,100000):
    out=i/0.1 + out
print("Float divide multi: ", time.monotonic()-start)

Resouces

About Author

Calendar

July 2020
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031