Cov txheej txheem:

OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Siv Tswj (TfCD): 4 Cov Kauj Ruam (nrog Duab)
OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Siv Tswj (TfCD): 4 Cov Kauj Ruam (nrog Duab)

Video: OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Siv Tswj (TfCD): 4 Cov Kauj Ruam (nrog Duab)

Video: OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Siv Tswj (TfCD): 4 Cov Kauj Ruam (nrog Duab)
Video: Musicians talk about Buckethead 2024, Kaum ib hlis
Anonim
OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Tswj Xyuas Kev Nyuaj Siab (TfCD)
OLED Tswmciab Lub Teeb Hluav Taws Xob Nrog Fotoresistance rau Kev Tswj Xyuas Kev Nyuaj Siab (TfCD)

Hauv cov lus qhia no peb qhia koj yuav ua li cas thiaj ua lub Circuit Court uas qhia pom (O) LED flickering zoo li tswm ciab thiab ua rau lub zog nyob ib puag ncig zoo li cas. Nrog lub teeb pom kev qis qis yuav tsum muaj lub teeb qis dua los ntawm cov teeb pom kev zoo. Nrog rau daim ntawv thov no koj tuaj yeem tsim koj tus kheej lub tswm ciab flickering los ua kom lub teeb nyob hauv tsev xis nyob thiab xis nyob rau huab cua ntxiv. Koj tuaj yeem sim hloov lub LED nrog OLED yog tias koj muaj cov khoom siv (Tam sim no lawv nyuaj rau tau txais vim tus nqi thiab me nyuam yaus ntawm thev naus laus zis). Cov thev naus laus zis tshiab no yuav yog yav tom ntej ntawm lub xeev teeb pom kev zoo.

Kauj Ruam 1: Kauj Ruam 1: Sau Cov Khoom

Kauj Ruam 1: Sau Cov Khoom
Kauj Ruam 1: Sau Cov Khoom

Sau cov khoom:

1x Arduino Uno + USB cable

1 x Breadboard

3 x 330R resistor

1 x 220R resistor

1 x Foto resistor

10x kab

Kauj Ruam 2: Kauj Ruam 2: Teeb Koj Arduino Breadboard

Kauj Ruam 2: Teeb Koj Arduino Breadboard
Kauj Ruam 2: Teeb Koj Arduino Breadboard

Teem koj lub arduino breadboard raws li daim duab.

Kauj Ruam 3: Kauj Ruam 3: Tshaj Tawm Txoj Cai

Kauj ruam 3: Upload Code
Kauj ruam 3: Upload Code

Upload cov cai hauv qab no. Values tuaj yeem hloov kho lossis ntxiv rau qhov xav tau sib txawv.

int ledPin1 = 9; int ledPin2 = 10; int ledPin3 = 11; int lightSensor = A1; int randomValue = 120; int puagValue = 135;

void teeb () {// initialize serial communication ntawm 9600 ntsis ib ob: Serial.begin (9600); tus pinMode (ledPin1, OUTPUT); tus pinMode (ledPin2, OUTPUT); tus pinMode (ledPin3, OUTPUT); }

// lub voj kev khiav ib zaug thiab ntau dua ib txhis: void loop () {// nyeem cov tswv yim ntawm analog pin 0: int sensorValue = analogRead (A1); yog (sensorValue> 800) {randomValue = 120; baseValue = 135; } lwm yog (sensorValue> 750) {randomValue = 110; baseValue = 115; } lwm yog (sensorValue> 700) {randomValue = 90; baseValue = 100; } lwm yog (sensorValue> 650) {randomValue = 70; baseValue = 80; } lwm yog (sensorValue> 600) {randomValue = 55; baseValue = 65; } lwm yog (sensorValue> 550) {randomValue = 40; baseValue = 55; } lwm {randomValue = 30; baseValue = 40; } // luam tawm tus nqi koj nyeem: Serial.println (sensorValue); analogWrite (ledPin1, random (randomValue)+baseValue); analogWrite (ledPin2, random (randomValue)+baseValue); analogWrite (ledPin3, random (randomValue)+baseValue); ncua (random (100)); }

Kauj Ruam 4: Kauj Ruam 4: Txheeb Xyuas Qhov Tseeb

Image
Image

Txheeb xyuas yog tias (O) LED flicker zoo li lub tswm ciab thiab ua haujlwm ntawm lub teeb pom kev ntawm ib puag ncig.

Pom zoo: