199 Wio: Wio Terminal and CircuitPython (199.html)

Keywords

REPL minicom MicroPython SeeedStudio Asduino Circuit Python CircuitPython CPython "199 Wio: Wio Terminal and CircuitPython " K001-V26 M5Stack ICH180RR AIP ArduPy "Wio Terminal" WioTerminal MicroPython "IX system" flash up2 Rings "Ring Mouse" "HTML Character Entities" "html entities"

(To enlarge .....Click it)
thumb: IXimage.jpg
IX or DC (IX by DC) or "|><"


This prepIX.py software is a part of the IX family of software.

Introduction

Circuit Python is the official programming language for the Wio Terminal. MicroPython is also supported but to a lesser extent. The uf2 for CircuitPython can be downloaded from Source 03, with an introduction at Source 02 and offical release notes at Source 04.

Exploring a New Wio Terminal

Click on the photo to enlarge it.
thumb: IMG_4965.jpg

Wio Terminal Game

First Boot of CPython uf2 on the Wio Terminal

REPL I 8.1.0

Adafruit CircuitPython 8.1.0 on 2023 05-22; Seeeduino
 Wio Terminal with samd51p19
Board ID:seeeduino_wio_terminal
UID:FCA243B9385350532020204B2B3D0FFF

Auto-reload is on. Simply save files over USB to run
them or enter REPL to disable.
code.py output:
Hello World!

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload
.

Adafruit CircuitPython 8.1.0 on 2023-05-22; Seeeduino
 Wio Terminal with samd51p19
>>> []0;Done I 8.^[]0;REPL I 8.
Now that a up2 has been loaded, it seems that the little game is gone forever

CircuitPython: sdcardio - Interface to an SD card via the SPI bus

CircuitPython
https://docs.circuitpython.org > latest > shared-bindings
Controls an SD card over SPI. This built-in module has higher read performance than the library adafruit_sdcard, but it is only compatible with busio.
> Available on these boards

Seeed Studio XIAO ESP32C3
Seeed XIAO nRF52840 Sense
Seeeduino Wio Terminal
Seeeduino XIAO RP2040
class sdcardio.SDCard(bus: busio.SPI,cs:microcontroller.Pin,baudrate:int=8000000)
SD Card Block Interface

Controls an SD card over SPI. This built-in module has higher read performance than the library adafruit_sdcard, but it is only 
compatible with busio.SPI, not bitbangio.SPI. Usually an SDCard object is used with "storage.VfsFat" to allow file I/O to an SD card.

Construct an SPI SD Card object with the given properties

Parameters:
   •  spi (busio.SPI) — The SPI bus

   •  cs (microcontroller.Pin) — The chip select connected to the card

   •  baudrate (int) — The SPI data rate to use after card setup

Note that during detection and configuration, a hard-coded low baudrate is used. Data transfers 
use the specified baudrate (rounded down to one that is supported by the microcontroller)

Important

If the same SPI bus is shared with other peripherals, it is important that the SD card be initialized 
before accessing any other peripheral on the bus. Failure to do so can prevent the SD card from 
being recognized until it is powered off or re-inserted.

Very Very Important

Refer to Source 06 and Source 07 and source 08 to learn about preparing / accessing your SD card.

Create a mount_sd.py file

instructions how to do this are non-existant Doh ------
import mount_sd
the links to this are broken !!! Doh --------

program

import os

import board
import sdcardio
import storage

sd = sdcardio.SDCard(board.SPI(), board.SD_CS)
# [D@CC] it says "no SD card" (probably wrong format or preparation)
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')
os.listdir('/sd')

count()-> int

     Returns : the total number of sectors

    Due to technical limitations, this is a function and not a property.

     Returns : The number of 512-byte blocks, as a number

deinit()-> None

     Disable permanently.

          Returns : None

readblocks(start_block: int, buf: circuitpython_typing.WriteableBuffer)-> None

     Read one or more blocks from the card

          Parameters : 
                 • start_block (int) — The block to start reading from

                 • buf (WriteableBuffer) —The buffer to write into. Length must be multiple of 512.

             Returns :None

sync()-> None

      Ensure all blocks written are actually committed to the SD card

          Returns : None

writeblocks(start_block: int, buf: circuitpython_typing.ReadableBuffer)-> None

     Write one or more blocks to the card

         Parameters :
                 • start_block (int) — The block to start writing from

                 • buf (ReadableBuffer) — The buffer to read from. Length must be multiple of 512.

             Returns : None

Coolwell WaveShare Sense HAT


(To enlarge .....Click it)
thumb: CoolWell_Sense_Hat.jpg
CoolWell Sense Hat

11. RT9193-33: 3.3V linear regulator


(To enlarge .....Click it)
thumb: CoolWell_Sense_Hat_3D.jpg
CoolWell Sense Hat 3D




Device 11 in the above image (left) is identified below the image. More information about the CoolWell Sense Hat can be found in Source 15 below. It's price is US$ 41.79 at Amazon (or US# 21.99 directly from Waveshare.com). A wiki (describing it in more detail) with software can be found at Source 16. Some of its features can be found in a different sensor, the Wio Terminal described in other articles by the author of this webpage.

Conclusion

Other Related Thoughts

(To enlarge .....Click it)
thumb: MTY4ODg1NTkyNTI4NTExMw_266262_5XkEr08QOiD46V8c_1681266921.png
The New Ring Mouse


See the new Ring Mouse in Source 10. The four buttons are "Left Click", "Right Click", "Wheel Up" and "Wheel Down". You click the tiny buttons with your thumb, while wearing the ring on your index finger. Source 11 describes how to get a tiny free board housing the Seeed Studio XIAO nRF52840 IC (which is the heart of the Ring Mouse. You make the plastic part of the Ring Mouse using a 3D printer, of course.

Video V02 explains how to use an earlier version of a Ring Mouse.

Useful html character entities can be found in Source 05 and Source 12. My favorites are listed in Article 1 (Source 13).

See Source 14 for " must-have accessories for the Raspberry Pi:

External Sources

Video Sources

Video Source V199:01: Wio Terminal Classroom with Ardupy #5 | AIP Usage & Ardupy Libraries (25:07 min) By Lakshantha of Seeed Studio c2021DApr
Video Source V199:02: Mini Ring Mouse review for DC World (5:36 min) By Jenson 2022EMay28
Video Source V199:03: Scroll Down 10% to find the Mini Ring Mouse review for DC World (No Ads) (5:36 min) By Jenson 2022EMay28


Web Sources

Web Source S199:01:www CircuitPython Libraries by Adafruit 2023EMay17
Web Source S199:02:www Introduction to CircuitPython (& uf2) on Wio Terminal ( by Seeed Studio 2023EMay22
Web Source S199:03:www CircuitPython (& uf2 8.1.0) on Wio Terminal ( by Seeed Studio 2023EMay22
Web Source S199:04:www ff2 Release Notes for 8.1.0 by dhalbert 2023EMay22
Web Source S199:05:www Some Useful HTML Character Entities by w3schools 2023EMay22
Web Source S199:06:www Circuit Python: Preparing your SD Card at adafruit 2023EMay22
Web Source S199:07:www adafruit_bus_device.spi_device – SPI Device Manager (Examplel) at adafruit 2023EMay22
Web Source S199:08:www Adafruit CircuitPython Module Install (Essential) at adafruit 2023EMay22
Web Source S199:09:www I2C - How It works by Kelvin 2022ISep00
Web Source S199:10:www Ring Mouse based on Seeed Studio XIAO nRF52840 by Serena Liang 2023DApr00
Web Source S199:11:www Seeed Studio XIAO nRF52840 by Amanda Sun 2022EMay00
Web Source S199:12:www Character Entities for HTML, CSS and Javascript at github 2023EMay22
Web Source S199:13:www 1 IT Tips by David KC COLE (See Tip 13) by D@CC on 2023EMay24
Web Source S199:14:www 3 Must-Have Accessories for the RPi by Arian Kingsley-Hughes on 2023AJan19
Web Source S199:15:www CoolWell Waveshare Sense Hat from the WaveShare Store before 2022
Web Source S199:16:www CoolWell Waveshare Sense Hat Wiki from the WaveShare.com site before 2023


WebMaster: Ye Old King Cole

There is a way to "google" any of the part-numbers, words and phrases in all my articles. This "google" search limits itself ONLY to my articles. Just go to the top of "ePC Articles by Old King Cole" and look for the "search" input box named "freefind".

Click here to return to ePC Articles by Old King Cole

Date Written: 2023 E May 22
Last Updated: 2023 J Oct 11

All rights reserved 2023 by (c) ICH180RR

saved in E:\E\2022\DevE\MyPagesE\Globat\ePhotoCaption.com\a\199\199.html
backed up to ePhotoCaption.com\a\199\199_2023EMay22.html

Font: Courier New 10 (monospaced)
/199.html