Cov txheej txheem:

Rudimentary EMF Ntes: 3 Kauj Ruam
Rudimentary EMF Ntes: 3 Kauj Ruam

Video: Rudimentary EMF Ntes: 3 Kauj Ruam

Video: Rudimentary EMF Ntes: 3 Kauj Ruam
Video: Reactivity Series Trick 2024, Kaum ib hlis
Anonim
Rudimentary EMF Ntes
Rudimentary EMF Ntes
Rudimentary EMF Ntes
Rudimentary EMF Ntes

Qhov no yog qhov haujlwm uas xav tau kev paub me ntsis nrog cov khoom siv hluav taws xob thiab arduinos. Cov cuab yeej tshwj xeeb yog lub ntsuas EMF yooj yim uas khaws cov nqi yuam kev los ntawm nws ib puag ncig. Yog tias lub kav hlau txais xov nthuav tawm los ntawm arduino nyob hauv thaj tsam ntawm cov xov hlau lossis qee yam khoom siv hluav taws xob, lub teeb liab yuav ci. Cov cuab yeej xav tau rau txoj haujlwm no yog arduino, 100k ohm resistor, xov hlau, lub khob cij, thiab coj. Kev tshoov siab rau txoj haujlwm no los ntawm EMF Ntes tau ua ntawm

Kauj Ruam 1: Sau Cov Khoom Uas Xav Tau

Sau Cov Khoom Uas Xav Tau
Sau Cov Khoom Uas Xav Tau
  1. Arduino
  2. 100k Ohm Resistor (Kuj)
  3. Hlau
  4. Cov qhob cij
  5. Coj

Cov khoom no yuav yooj yim txaus kom nrhiav tau txhua qhov khoom siv hluav taws xob raug muag. Txoj haujlwm no yog npaj kom nkag mus tau rau cov uas tsis muaj kev paub txog hluav taws xob. Yog tias koj tsis paub nrog cov laug cam hais txog qhov txuas no:

Kauj ruam 2: Code

Code
Code

C ++ txoj cai hauv qab no yog qhov kuv tau siv los ua kom muaj kev nkag siab txaus rau qhov kev hloov pauv tus nqi nce mus txog tus kav hlau txais xov.

int inPin = 5;

int var = 0; pin 11 = 11;

void teeb tsa () {

Serial.begin (9600);

}

void voj () {

var = analogRead (inPin);

yog (var> = 1) {

var = map (var, -1000, 100, 1, 255);

analogWrite (tus pin 11, var);

lwm yam {

analogWrite (tus pin 11, 0);

}

Serial.println (var);

}

Pom zoo: