Circuitpython : #3 hellow world Tutorial 2

python

素材

ItsyBitsy M0 Express
Arch linux

For Arch linux

USB drive auto mount をインストール

key Open mounted CIRCUITPY

CIRCUITPY/code.py

/.Trashes
/.fseventsd
/.metadata_never_index
/README.txt
/System Volume Information
/Windows 7 Drivers
/boot_out.txt
/code.py
/laugh.wav
/lib
/main.py
/rimshot.wav

Install mu-editor (optional)

Install Snaped

sudo snap install mu-editor --classic

Hello world 1

Connect pc and circuitpython

mu-editor

key

OK

key

New

CIRCUITPY/code.py

import board
import digitalio
import time

led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.1)
    led.value = False
    time.sleep(0.5)

key

Save

Hello world 2

CIRCUITPY/code.py

import board
import digitalio
import time

led = digitalio.DigitalInOut(board.D10)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.1)
    led.value = False
    time.sleep(0.5)

Circuitpython board/10 → LED anode(+, Long leg) [--|] LED cathode(-、Short legs) → 470 ohm resistor → Circuitpython board/Any of[G,USB,5!]

thank you

Thank you for watching until the end. I'm glad if you can use it as a reference.

Thank you for Helping

Give money to us for Amazon gift

We will continue to update useful information. I am delighted to jump to your help. Thank you very much.