Laboratoriya ishi № Potensiometr. Laboratoriya ishining maqsadi


LABORATORIYA UCHUN TOPSHIRIQLAR



Download 1,46 Mb.
bet2/10
Sana09.06.2022
Hajmi1,46 Mb.
#646614
1   2   3   4   5   6   7   8   9   10
Bog'liq
2- dedline7-12 gacha

LABORATORIYA UCHUN TOPSHIRIQLAR

  1. Potensiometr qiymatini arduino platformasini tashlash.






Dasturiy qismi:


// C++ code
//
/*
Analog Input Demonstrates analog input by
reading an analog sensor on analog pin 0 and
turning on and off a light emitting diode(LED)
connected to digital pin 13. The amount of time
the LED will be on and off depends on the value
obtained by analogRead().


The circuit:
* Potentiometer attached to analog input 0
* center pin of the potentiometer to the analog
pin
* one side pin (either one) to ground
* the other side pin to +5V
* LED anode (long leg) attached to digital
output 13
* LED cathode (short leg) attached to ground
* Note: because most Arduinos have a built-in
LED attached to pin 13 on the board, the LED is
optional.


Created by David Cuartielles
modified 30 Aug 2011 By Tom Igoe


This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/AnalogInput
*/


int sensorValue = 0;


void setup()
{
pinMode(A0, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
}


void loop()
{
// read the value from the sensor
sensorValue = analogRead(A0);
// turn the LED on
digitalWrite(LED_BUILTIN, HIGH);
// stop the program for the
// milliseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
// turn the LED off
digitalWrite(LED_BUILTIN, LOW);
// stop the program for the
// milliseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
}



Download 1,46 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish