Cov txheej txheem:

ScriptBox: 3 Kauj ruam
ScriptBox: 3 Kauj ruam

Video: ScriptBox: 3 Kauj ruam

Video: ScriptBox: 3 Kauj ruam
Video: Tsov khawb yawg Vaj hua tim qhov ntxa 3/16/2022 2024, Kaum ib hlis
Anonim
Image
Image
Qhov Yuav Tsum Tau Ua Rau ScriptBox
Qhov Yuav Tsum Tau Ua Rau ScriptBox

ScriptBox yog cov cuab yeej siv arduino, lees paub los ntawm lub khoos phis tawj ua cov keyboard, uas tuaj yeem siv rau kev txhaj tshuaj.

Qhov zoo ntawm kev siv ScriptBox yog:

  • Koj tuaj yeem siv tus pin txhawm rau qhib ScriptBox yog li koj tsuas yog siv tau
  • Koj tuaj yeem muaj cov ntawv sau ntau npaum li koj xav tau
  • Koj tuaj yeem pom qhov xwm txheej tam sim no ntawm koj li ScriptBox (khiav, yuam kev, tos lwm yam) nrog kev pab los ntawm RGB Led

Kauj Ruam 1: Qhov Yuav Tsum Tau Ua Rau ScriptBox

Yog tias koj xav tsim koj tus kheej ScriptBox, koj yuav xav tau cov hauv qab no:

  • Arduino Pro Micro Cov
  • MicroSd Qauv
  • 1 x 4 Keypad
  • RGB Led - Cathode Feem ntau
  • 3 x 330 Ohm Resistor (Kuv tau siv 220 Ohm Resistor, tab sis lub teeb tawm los ntawm RGB Led nws muaj zog thiab tsis xis nyob
  • 3D Luam Ntawv Box (yuav muab cov ntaub ntawv ntxiv)
  • MicroSD daim npav

Kauj Ruam 2: Daim Duab Sib Txuas

Daim duab sib txuas
Daim duab sib txuas

Kuv tau ua cov kev sib txuas hauv qab no:

1x4 Keypad - Arduino Pro Micro

pin 1 pin 2

pin 2 pin 3

pin 3 pin 4

pin 4 pin 5

pin 5 with GND

RGB Coj - Arduino Pro Micro

GND nrog GND

3 tus pin los ntawm RGB Led (siv tus tiv thaiv - saib daim duab) nrog 18, 19, 20 (A0, A1, A2) pins ntawm Arduino.

Nco tseg: Yog tias koj tsis tuaj yeem pom qhov kev txiav txim kom raug txuas tus pin, RGB Led yuav sawv cev rau lub xeev sib txawv ntawm ScriptBox nrog cov xim sib txawv ntawm qhov kuv xaiv. Piv txwv: Tsis txhob siv lub teeb liab thaum tus pin tsis raug, nws yuav qhia lub teeb xiav. Txhawm rau kho qhov no koj muaj 2 txoj kev xaiv:

1. Hloov kho qhov pib ntawm RGB Led pins hauv txoj cai los ntawm Kauj Ruam 4 (pom zoo):

// RGB Coj tus pin

int redPin = 18; int greenPin = 19; int bluePin = 20;

Yog li, yog tias koj muaj xim xiav thaum tus pin tsis raug hloov rau liab, koj tuaj yeem hloov mus rau qhov teeb tsa no:

// RGB Coj tus pin

int redPin = 20; int greenPin = 19; int bluePin = 18;

2. Sim nrhiav txoj cai txuas tus lej xaj

MicroSD Module - Arduino Pro Micro:

GND nrog GND

VCC nrog VCC

MISO nrog MISO (tus pin 14)

MOSI nrog MOSI (tus pin 16)

SCK nrog SCLK (tus pin 15)

CS 7 pin

Pom zoo: