|
O‘rnatilgan tizimlari fanidan 4-amaliy ish topshiriq bajardi
|
Sana | 17.05.2024 | Hajmi | 291,22 Kb. | | #239816 |
Bog'liq Bahora
O‘ZBEKISTON RESPUBLIKASI
RAQAMLI TEXNOLOGIYALAR VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
Kompyuter injiniringi fakulteti
Sun’iy intellekt kafedrasi
O‘rnatilgan tizimlari fanidan
4-AMALIY ISH TOPSHIRIQ
Bajardi:411-21 guruh talabasi
Rustamova Bahora
Tekshirdi: Azimova U.
TOSHKENT – 2024
4-topshiriq
Ishdan maqsad: Tranzistor, fotoqarshilik va harorat datchigi xususiyatlarini
o‘rganish va ular haqida ma’lumot olish. Ularni boshqarish uchun datchiklarning
ishlash prinsiplari, qurilmaga ulanishi va dastur yozish ko‘nikmalarini hosil qilish
#include
SevSeg sevSeg;
uint8_t segValues[10]={0X3f,0X06,0X5B,0X4F,0X66,0X6D,0X7C,0X07,0X7F,0X6F};
const float BETA = 3950;
const int Relay=13;
void setup() {
byte segPins[]={2,3,4,5,6,7,8,9};
byte dispPins[]={10,11,12};
sevSeg.begin(COMMON_CATHODE,3,dispPins,segPins,false,false,false,true);
pinMode(Relay, OUTPUT);
//Serial.begin(9600);
//sevSeg.setNumber(234,0,0);
}
void loop() {
int sampleValue=analogRead(A0);
float celsius = 1 / (log(1 / (1023. / sampleValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
int temp=int(celsius+0.5);// t
//Serial.print(temp);
if(temp>=23)
digitalWrite(Relay, HIGH);
else
digitalWrite(Relay, LOW);
int ones=temp%10;
int tens=temp/10;
//int hundreds=celsius/100;
sevSeg.setSegmentsDigit(1,segValues[ones]);//to
sevSeg.setSegmentsDigit(0,segValues[tens]);
sevSeg.setSegmentsDigit(2,0x63);
sevSeg.refreshDisplay();
}
https://wokwi.com/projects/397783806191149057
|
| |