Ñîçäàíèå Ñâåòîôîðà ñ ñèãíàëèçàöèåé íà îñíîâå Arduino UNO


ïåðåõîä íà ãëàâíóþ ñòðàíèöó
Ìîíòàæíàÿ Ñõåìà:















ÈÑÏÎËÜÇÓÅÌÛÅ ÊÎÌÏÎÍÅÍÒÛ
ÑÂÅÒÎÄÈÎÄ 3 ØÒ
ÏËÀÒÀ ÀÐÄÓÈÍÎ UNO
ÌÀÊÅÒÍÀß ÏËÀÒÀ
ÝÊÐÀÍ I2C LCD1602
ÏÐÎÂÎÄÀ 9 ØÒ
ÁÓÇÅÐ
ÐÅÇÈÑÒÎÐ 3 ØÒ 200 ÎÌ
ÏÐÈÍÖÈÏ ÐÀÁÎÒÛ:
1. ÇÀÃÎÐÀÅÒÑß ÑÂÅÒÎÄÈÎÄ 1
2. ÍÀ ÄÈÑÏËÅÅ ÂÛÑÂÅ×ÈÂÀÅÒÑß ÍÀÄÏÈÑÜ: STOP
3. ÑÂÅÒÎÄÈÎÄ 1 ÃÀÑÍÅÒ
4. ÐÀÇÄÀÅÒÑß ÇÂÓÊÎÂÎÉ ÑÈÃÍÀË
5. ÇÀÃÎÐÀÅÒÑß ÑÂÅÒÎÄÈÎÄ 2
6. ÍÀ ÄÈÑÏËÅÅ ÂÛÑÂÅ×ÈÂÀÅÒÑß ÍÀÄÏÈÑÜ: NE DVIGAYSA
7. ÑÂÅÒÎÄÈÎÄ 2 ÃÀÑÍÅÒ
8. ÐÀÇÄÀÅÒÑß ÇÂÓÊÎÂÎÉ ÑÈÃÍÀË
9. ÑÂÅÒÎÄÈÎÄ 3 ÇÀÃÎÐÀÅÒÑß
10. ÍÀ ÄÈÑÏËÅÅ ÂÛÑÂÅ×ÈÂÀÅÒÑß ÍÀÄÏÈÑÜ: BEGY !!!!
11. ÑÂÅÒÎÄÈÎÄ 3 ÃÀÑÍÅÒ
12. ÐÀÇÄÀÅÒÑß ÇÂÓÊÎÂÎÉ ÑÈÃÍÀË
13. ÏÐÎÃÐÀÌÌÀ ÏÎÂÒÎÐßÅÒÑß ÇÀÍÎÂÎ
















Ïðîãðàììà:
#include
#include
//Ïîäêëþ÷åíèå ïî I2C Æê ýêðàí (SDA-> A4, SCL ->A5)
//LiquidCrystal_I2C lcd(0x3f,16,2); // set the LCD address to 0x3f for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27,16,2); // // set the LCD address to 0x27 for a 16 chars and 2 line display
//=======================================
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
lcd.init(); // initlcd ialize the lcd
lcd.backlight();//Âêëþ÷èòü ïîäñâåòêó
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("CVETOFOR");
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
//ÂÊË ÐÅÄ
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("STOP");
digitalWrite(13, HIGH);
delay(3000);
//ÂÛÊË ÐÅÄ
digitalWrite(13, LOW);
delay(20);
//ÂÊË ÏÈÙÀËÊÀ
digitalWrite(11, HIGH);
delay(20);
//ÂÛÊË ÏÈÙÀËÊÀ
digitalWrite(11, LOW);
delay(20);
//ÂÊË ÅËÎÓ
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("NE DVIGAYSA");
digitalWrite(12, HIGH);
delay(3000);
//ÂÛÊË ÅËÎÓ
digitalWrite(12, LOW);
delay(20);
//ÂÊË ÏÈÙÀËÊÀ
digitalWrite(11, HIGH);
delay(20);
//ÂÛÊË ÏÈÙÀËÊÀ
digitalWrite(11, LOW);
delay(20);
//ÂÊË ÁËÓ
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("BEGY !!!!!");
digitalWrite(10, HIGH);
delay(3000);
//ÂÛÊË ÁËÓ
digitalWrite(10, LOW);
delay(20);
//ÂÊË ÏÈÙÀËÊÀ
digitalWrite(11, HIGH);
delay(20);
//ÂÛÊË ÏÈÙÀËÊÀ
digitalWrite(11, LOW);
delay(20);
}

ïåðåõîä íà ãëàâíóþ ñòðàíèöó