Cov txheej txheem:

Siv Kitronik Inventor's Kit Nrog Adafruit CLUE: 4 Cov Kauj Ruam (nrog Duab)
Siv Kitronik Inventor's Kit Nrog Adafruit CLUE: 4 Cov Kauj Ruam (nrog Duab)

Video: Siv Kitronik Inventor's Kit Nrog Adafruit CLUE: 4 Cov Kauj Ruam (nrog Duab)

Video: Siv Kitronik Inventor's Kit Nrog Adafruit CLUE: 4 Cov Kauj Ruam (nrog Duab)
Video: Представляем новый комплект Microbit v2 Go Kit 2024, Kaum ib hlis
Anonim
Siv Kitronik Inventor's Kit Nrog Adafruit CLUE
Siv Kitronik Inventor's Kit Nrog Adafruit CLUE
Siv Kitronik Inventor's Kit Nrog Adafruit CLUE
Siv Kitronik Inventor's Kit Nrog Adafruit CLUE

Los ntawm kevinjwaltersFollow More los ntawm tus sau:

Ua Tus Xeem Cheeb Tsam Nrog Adafruit CLUE thiab Kitronik Inventor's Kit
Ua Tus Xeem Cheeb Tsam Nrog Adafruit CLUE thiab Kitronik Inventor's Kit
Ua Tus Xeem Cheeb Tsam Nrog Adafruit CLUE thiab Kitronik Inventor's Kit
Ua Tus Xeem Cheeb Tsam Nrog Adafruit CLUE thiab Kitronik Inventor's Kit
Plotting Cov Qib Carbon Dioxide Nrog Pimoroni Enviro+ FeatherWing thiab Adafruit SCD-30
Plotting Cov Qib Carbon Dioxide Nrog Pimoroni Enviro+ FeatherWing thiab Adafruit SCD-30
Plotting Qib Carbon Dioxide Nrog Pimoroni Enviro+ FeatherWing thiab Adafruit SCD-30
Plotting Qib Carbon Dioxide Nrog Pimoroni Enviro+ FeatherWing thiab Adafruit SCD-30
Av noo noo Paub nrog Tus Tsim Pi Pico
Av noo noo Paub nrog Tus Tsim Pi Pico
Av noo noo Paub nrog Tus Tsim Pi Pico
Av noo noo Paub nrog Tus Tsim Pi Pico

Kitronik Inventor's Kit rau BBC micro: me ntsis yog qhov qhia zoo rau microcontrollers nrog cov khoom siv hluav taws xob siv lub khob cij. Cov khoom siv no tau tsim los siv nrog pheej yig BBC micro: me ntsis. Phau ntawv qhia ntxaws uas los nrog cov khoom suav nrog MakeCode piv txwv siv Blocks thiab JavaScript sib npaug code rau ob peb qhov haujlwm kawg. Qhov no zoo dua rau cov pib thiab cov menyuam yaus tshaj li C/C ++ xav tau rau Arduino-style programming. Kitronik tseem muab MicroPython cov qauv ntawm cov lej ntawm lawv lub vev xaib hauv qab Cov Khoom Tsim Kho Cov Khoom Siv Ntxiv Ntxiv seem.

Adafruit CLUE yog qhov ua tau zoo dua ntawm cov micro: me ntsis nrog cov txheej txheem nrawm dua, puv xim 240x240 LCD npo, sib txuas ntawm ntug sib xws, ntau lub ntsej muag thiab lub ntsej muag me me hais lus. Kev sib txuas ntawm ntug yog qhov tseem ceeb thiab tso cai rau siv lub rooj tsav khoom no nrog ntau yam khoom lag luam uas twb muaj lawm xws li Cov Khoom Tsim Khoom. CLUE tam sim no txhawb nqa Arduino-style programming thiab CircuitPython. CircuitPython yog qhov muab los ntawm MicroPython - nws zoo sib xws tab sis muaj qee qhov sib txawv, tshwj xeeb tshaj yog nyob ib ncig ntawm lub tsev qiv ntawv.

Txoj haujlwm no qhia pom yuav siv CircuitPython cov tsev qiv ntawv ntawm CLUE kom ua raws li micro: me ntsis microbit thiab cov tsev qiv nkauj. Qhov no tso cai rau MicroPython cov cai kom ua raws li-yog rau kaum qhov haujlwm hauv Tus Tsim Cov Khoom thiab ob txoj haujlwm ntxiv los ntawm lub vev xaib. CLUE kuj tseem tuaj yeem siv rov sau txhua txoj cai hauv CircuitPython tab sis ob khub ntawm cov tsev qiv ntawv no muaj txoj hauv kev sai sai kom pib nrog cov khoom siv.

Ib qho kev ua kom pom tau zoo muaj kev pom ntxiv ntawm cov pins (pawm) raws li lawv tau nyeem los lossis sau rau. Qhov no qhia meej meej tias kev siv tswv yim thiab cov txiaj ntsig tau siv dab tsi uas tuaj yeem txhim kho txoj kev kawm paub.

Nco tseg: muaj qhov sib txawv ntawm cov khoom siv muaj rau Arduino Uno lossis Maker Uno Plus: Kitronik Inventor's Kit rau Arduino.

Khoom siv

  • Kitronik Inventor's Kit rau BBC micro: me ntsis
  • Adafruit NTAWV

Kauj Ruam 1: Txhim Kho CircuitPython Libraries

Txhim kho CircuitPython Libraries
Txhim kho CircuitPython Libraries

Yog tias pawg thawj coj tsis tau muaj CircuitPython ntawm nws ces ua raws cov lus qhia no thiab CIRCUITPY tsav yuav tsum tshwm sim. Cov ntawv tuaj yeem lees paub los ntawm kev tshuaj xyuas cov ntaub ntawv boot_out.txt lossis txuas rau REPL ntawm cov ntawv txuas hauv USB.

Cov tsev qiv ntawv hauv qab no yuav tsum tau rub tawm (nyem txoj cai thiab Txuag txuas li …) thiab muab tso rau hauv phau ntawv teev npe ntawm CIRCUITPY tsav.

  • microbit.py
  • nkauj.py
  • display_pin.py

Display_pin lub tsev qiv ntawv yog qhov vam khom ntawm lub tsev qiv ntawv me me. Lub tsev qiv ntawv adafruit_display_text yog kev vam khom ntawm lub microbit thiab display_pin cov tsev qiv ntawv thiab tuaj yeem muab rho tawm los ntawm Adafruit lub tsev qiv ntawv pob.

Adafruit CircuitPython Library bundles - rub tawm qhov no rau adafruit_display_text lub tsev qiv ntawv - daim duab saum toj no qhia qee qhov lwm lub tsev qiv ntawv muaj txiaj ntsig uas xav tau yog tias koj xav siv lub ntsuas cua, ntsuas thiab ntsuas pom.read_light_level ()

Cov program hauv qab no tuaj yeem rub tawm los qhia qee qhov peev xwm pom tau.

microbitlibemu_simpletest.py

Qhov no yuav tsum tau muab tso rau hauv cov npe saum toj kawg nkaus hauv CIRCUITPY thiab hloov pauv mus rau code.py.

Kauj Ruam 2: Txuas Cov Khoom Siv

Txuas Cov Cheeb Tsam
Txuas Cov Cheeb Tsam

Cov qauv hais los saum toj no tau tsim los siv nrog cov khoom siv txuas nrog micro: ntsis/CLUE raws li Kitronik Kev Tshawb Fawb 3. Kitronik phau ntawv qhia yuav ua li cas txuas cov no.

Nov yog cov ntsiab lus ntawm cov khoom siv thiab kev sib txuas.

  • pin0 - lub laub khawm hloov uas txuas cov tswv yim rau hauv av.
  • pin1 - 10k linear potentiometer.
  • pin2 - liab LED nrog 47k resistor hauv koob.
  • pin4 - tus hais lus piezo (qhov no tsis yog ib feem ntawm thawj qhov kev sim tab sis muaj txiaj ntsig zoo los ntsuas lub tsev qiv ntawv nkauj).

Kauj Ruam 3: Dimming LED Siv Pulse-Dav Modulation

Image
Image

Txoj haujlwm CLUE tau raug cuam tshuam ua ntej ua yeeb yaj kiab siv REPL ntawm cov ntawv txuas hauv USB. Tswj-D raug nias kom tawm REPL thiab pib qhov program.py.

Cov tsev qiv ntawv tau rub ua ntej hauv qhov program:

los ntawm microbit ntshuam *

ntshuam suab paj nruag

Tom qab ntawd "microbit" tau nthuav tawm los ntawm kev nqes mus rau hauv cov ntawv pom hom, ua raws los ntawm "tsev qiv ntawv" hauv hom kev pom yooj yim (tam sim no qeeb me ntsis), tom qab ntawd "ua raws ntawm CLUE" hauv hom kev txhim kho.

display.mode = "ntawv"

display.scroll ("microbit") display.mode = "basic" display.scroll ("library") display.mode = "enhanced" display.scroll ("emulation on CLUE") display.show (Image. SMILE) pw (2000)

Ob qho scroll () thiab qhia () hauv kev txhim kho hom qhia tag nrho kab ntawv ntawm CLUE lub vijtsam kom yooj yim nyeem. Raws li txhua tus pin tau siv lawv tso tawm ntawm lub vijtsam thiab raug ntsuas kom haum. Qhov siab tshaj tam sim no uas tuaj yeem pom yog 6.

display.show ("Kev sim 3 + suab paj nruag")

pw tsaug zog (2000) display.scroll ("Dimming LED") _ = pin1.read_analog () pw (2000) pin2.write_analog (pin1.read_analog ()) pw (2000) _ = pin0.is_touched () pw tsaug zog (2000) music.play (music. POWER_UP, tus pin4)

Cov nkauj ua si ntawm tus pin4 hauv qhov piv txwv no. Zoo li lub micro: kev siv me ntsis nws ua rau tus pin0 los ntawm lub neej ntawd. CLUE's onboard speaker kuj tseem tuaj yeem siv los ntawm kev dhau tus nqi (khoom) tus hais lus.

Cov cai hauv qab no yog ua raws Kitronik's MicroPython code uas tau los ntawm lawv qhov kev tsim MakeCode. Nws tau hloov kho tas li txhawm rau nyeem tus pin1 thiab sau rau tus pin2 yog tias lub LED tau qhib uas tau qhia los ntawm LightState tus nqi ntawm 1. Qhov no tso cai rau tus lej pom tus lej txhawm rau hloov kho tas li ntawm CLUE cov duab raws li pom hauv video thaum Allen (hex) qhov tseem ceeb tig lub potentiometer.

LightState = 0

Hloov = 0 thaum Tseeb: yog LightState == 1: pin2.write_analog (pin1.read_analog ()) lwm: pin2.write_digital (0) yog pin0.is_touched (): Hloov = 1 yog LightState == 0: LightState = 1 ntxiv: LightState = 0 thaum Hloov == 1: yog pin0.is_touched () == 0: Hloov = 0 yog button_b.was_pressed (): music.play (music. ODE, pin4)

Kauj Ruam 4: QHIA Nrog CircuitPython

CLUE Nrog CircuitPython
CLUE Nrog CircuitPython
CLUE Nrog CircuitPython
CLUE Nrog CircuitPython

Kitronik's MicroPython code tuaj yeem pom nyob hauv txhua qhov kev sim hauv Inventors Kit Ntxiv Ntu Cov Khoom Siv Dawb. Qee qhov cai tsuas yog muab tso rau hauv.hex cov ntaub ntawv. Txhawm rau kom yooj yim, tag nrho cov piv txwv tau rov ua dua ntawm no.

CLUE lub peev xwm tag nrho suav nrog Bluetooth Tsawg Zog tuaj yeem tshawb hauv CircuitPython nrog kev teeb tsa cov tsev qiv ntawv sai.

Adafruit qhov chaw muaj thawj phau ntawv qhia thiab ntau yam Kawm paub qhia rau CLUE. Peb daim duab saum toj no yog muab los ntawm:

  • HLAU BLE MIDI Hnab looj tes
  • CLUE Sensor Plotter
  • QHIA Altimeter

Pom zoo: