Cov txheej txheem:

Arduino Ntsuas: 4 Kauj Ruam
Arduino Ntsuas: 4 Kauj Ruam

Video: Arduino Ntsuas: 4 Kauj Ruam

Video: Arduino Ntsuas: 4 Kauj Ruam
Video: Logic Gates Learning Kit #2 - Transistor Demo 2024, Hlis ntuj nqeg
Anonim
Image
Image

Qhov ntsuas Arduino no tau ua nrog HC-SR04 Ultrasonic sensor thiab Force Force Sensitive Resistor. Koj tuaj yeem ua suab paj nruag los ntawm nias lub zog ntsuas, thiab yoj koj txhais tes ua ntej ntawm lub ntsuas hluav taws xob ultrasonic ntawm ntau qhov kev deb kom ua si sib txawv. Saib daim vis dis aus no seb nws ua haujlwm li cas!

Kauj Ruam 1: Cov khoom siv

Thaiv
Thaiv

Rau qhov haujlwm no, Koj yuav xav tau:

- Ib Arduino

- ib daim ntawm daim ntawv qhia zaub mov

- Ib Qho Kev Ruaj Ntseg Ruaj Ntseg

- Ib HC-SR04 Ultrasonic Sensor

- Ib qho 10k Ohm Resistor

- Kaum dhia xov hlau

Kauj ruam 2: Kev thaiv kab

Thaiv
Thaiv
Thaiv
Thaiv
Thaiv
Thaiv

Ultrasonic:

Txuas hauv av rau Arduino av, ncha mus rau tus lej digital 11, ua rau tus pin digital 10, thiab VCC rau 5V

Quab yuam rhiab heev Resistor:

Txuas ib tus coj mus rau 5V, thiab lwm tus coj ncaj qha rau A0. Tso lub resistor tom qab A0 xaim thiab txuas nws hauv av

Keyboard:

Txuas D4 rau GND kom cia cov keyboard hais kom ua haujlwm

Kauj ruam 3: Code

Txhawm rau kom koj lub cuab yeej ua haujlwm, koj yuav tsum ntxig ib qho ntawm cov lej rau hauv Arduino app, thiab ntxig rau lwm tus los kos.

Txoj cai siv rau Arduino yog txhawm rau paub qhov deb ntawm ultrasonic senor, tom qab ntawd nws yuav nias ib qho ntawm cov keyboard, uas yog "C E E F G A B". Txoj cai rau kos yuav raug siv los nkag siab cov keyboard nias thiab ua suab. "C = Do, D = Re, E = Mi, F = Fa, G = Sol, A = La, B = Si"

Cov lej muaj nyob hauv qhov txuas hauv qab no, koj tsuas yog yuav tsum luam thiab muab tso rau hauv cov apps.

Arduino code txuas:

Kos:

Kauj Ruam 4: Cov Khoom Kawg

Yog tias koj ua tiav txhua cov theem saum toj no nws yuav zoo li ib qho hauv cov vis dis aus hauv qab no, lossis zoo dua!

Pom zoo: