O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
O’rnatilgan Tizimlar fanidan
Laboratoriya ishi - 3
Bajardi: EBS002-L1 guruh talabasi Shahboz Shirinboyev
Tekshirdi: Nurmurodov J.
TOSHKENT – 2022 Labaratoriya-№3 1. Rele. Releni tranzistor orqali boshqarish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
2. Fotoqarshilik. Yorug‘lik diodlarini yoqish yoki o‘chirish orqali yorug‘lik darajasiga ishlov berish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
3. LM335 xarorat datchigi (uzuluksiz). Ishlash tamoili, ishlatishga misol…
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
4. RGB-yorug‘lik diodi. Impuls kengligining modulyatsiyasi.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
5. LCD1602 indikatori. Ulanish tamoili, unga axborotni Arduinoda foydalanib chiqarish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
6. Simsiz aloqa tarmoqlari orqali ma’lumotlarni uzatish va boshqarish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
7. Pezonurlatgich. Pezonurlatgichni boshqarish: tonni o‘zgartirish, davomiligini o‘zgartirish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
8. Tranzistorning kuchaytirish xususiyatini namoyish etish. Elektryuritgich misolida aylanishini o‘zgartirish.
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
9. Masofadan boshqaruvchi datchikni ishga tushirish NRF2 L01(asosida).
Vazifani https://www.tinkercad.com/ saytida bajaramiz.
Code for transmitter: #include #include #include RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001"; //Byte of array representing the address. This is the address where we will send the data. This should be same on the receiving side.
int button_pin = 2;
boolean button_state = 0;
void setup() {
pinMode(button_pin, INPUT);
radio.begin(); //Starting the Wireless communication
radio.openWritingPipe(address); //Setting the address where we will send the data
radio.setPALevel(RF24_PA_MIN); //You can set it as minimum or maximum depending on the distance between the transmitter and receiver.
radio.stopListening(); //This sets the module as transmitter
}
void loop()
{
button_state = digitalRead(button_pin);
if(button_state == HIGH)
{
const char text[] = "Your Button State is HIGH";
radio.write(&text, sizeof(text)); //Sending the message to receiver
}
else
{
const char text[] = "Your Button State is LOW";
radio.write(&text, sizeof(text)); //Sending the message to receiver
}
radio.write(&button_state, sizeof(button_state)); //Sending the message to receiver
delay(1000);
}
Code for receiver: #include #include #include RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
boolean button_state = 0;
int led_pin = 3;
void setup() {
pinMode(6, OUTPUT);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address); //Setting the address at which we will receive the data
radio.setPALevel(RF24_PA_MIN); //You can set this as minimum or maximum depending on the distance between the transmitter and receiver.
radio.startListening(); //This sets the module as receiver
}
void loop()
{
if (radio.available()) //Looking for the data.
{
char text[32] = ""; //Saving the incoming data
radio.read(&text, sizeof(text)); //Reading the data
radio.read(&button_state, sizeof(button_state)); //Reading the data
if(button_state == HIGH)
{
digitalWrite(6, HIGH);
Serial.println(text);
}
else
{
digitalWrite(6, LOW);
Serial.println(text);}
}
delay(5);
}