Hirdetés
- Az Enermax tényleg nem viccel, ha az új tápjának garanciaidejéről van szó
- Egybegép lesz vagy ház? A Corsair sem tudja eldönteni.
- A Qwertykeys új klaviatúrái szépek, igényesek és sokrétűek
- Összement a mosásban az ASUS új VGA-inak PCI Express 5.0 csatlakozója
- Billentyűzet-választó: mechanikus vs membrános – kinek melyik a jobb?
- Androidos fejegységek
- Telekom TV SmartBox: szolgáltatói set-top box alacsony korlátokkal
- Melyik tápegységet vegyem?
- Milyen TV-t vegyek?
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Milyen egeret válasszak?
- Sikerült önállóan 1 GHz-re és két magra ugrania Indiának
- És akkor a memóriapánik után beköszöntött a HDD-pánik
- E-book olvasók
- Kormányok / autós szimulátorok topikja
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Tomi8822
tag
Üdv, valaki tudna segíteni nekem?
Ezt a programot szeretném használni de úgy hogy 6 db relét tudjak egyesével időre kapcsolni, lényegében 6 relére kéne kibővíteni. Eggyel működik gond nélkül.// Date and time functions using a DS3231 RTC connected via I2C and Wire Lib
#include <Wire.h>
#include <RTClib.h>
#include <Time.h>
#include <TimeAlarms.h>RTC_DS1307 RTC;
// Start Time
int sHour = 11;
int sMinute =30;
int sSecond = 0;// End Time
int eHour = 11;
int eMinute = 30;
int eSecond = 4;int lightRelay = 2;
void setup() {
// Set the relay to off immediately
digitalWrite(lightRelay, HIGH);Serial.begin(9600);
Wire.begin();
RTC.begin();// Set the pinmode
pinMode(lightRelay, OUTPUT);// Notify if the RTC isn't running
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running");
}// Get time from RTC
DateTime current = RTC.now();
DateTime compiled = DateTime(__DATE__, __TIME__);
if (current.unixtime() < compiled.unixtime()) {
Serial.println("RTC is older than compile time! Updating");
RTC.adjust(DateTime(__DATE__, __TIME__));
}// Use RTC time to set the start time
setTime(sHour, sMinute, sSecond, current.day(), current.month(), current.year());
time_t s = now();// Use RTC time to set the end time
setTime(eHour, eMinute, eSecond, current.day(), current.month(), current.year());
time_t e = now();// Use RTC time to set the current time
setTime(current.hour(), current.minute(), current.second(), current.day(), current.month(), current.year());
time_t n = now();// Test if grow light should be on
if (s <= n && n <= e) {
digitalWrite(lightRelay, LOW); // Sets the grow light "on"
}Alarm.alarmRepeat(sHour, sMinute, sSecond, LightOn);
Alarm.alarmRepeat(eHour, eMinute, eSecond, LightOff);
}void loop() {
DateTime now = RTC.now();
setTime(now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());Serial.print("Current time: ");
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();Serial.println();
Alarm.delay(1000);
}void LightOn() {
Serial.println("Turning Light On");
digitalWrite(lightRelay, LOW);
}void LightOff() {
Serial.println("Turning Light Off");
digitalWrite(lightRelay, HIGH);
}
Új hozzászólás Aktív témák
- Androidos fejegységek
- One mobilszolgáltatások
- Telekom TV SmartBox: szolgáltatói set-top box alacsony korlátokkal
- Melyik tápegységet vegyem?
- Milyen TV-t vegyek?
- Mozilla Thunderbird
- Íme az év legszebb játékai - a Digital Foundry szerint
- BMW topik
- Chieftec-Prohardver nyereményjáték
- Energiaital topic
- További aktív témák...
- Dell Latitude 7210 2-in-1 12" FHD touch, i7 10610U, 16GB RAM, 512GB SSD, jó akku, számla, 6 hó gar
- Playstation 5 lemezes / PS5 base (disc) edition
- Dell Latitude 5440 - i7-1365U, 32GB RAM, 1TB SSD, jó akku számla, garancia
- Intel Core i7-10700 csere Intel Core i7-10700k - ra +KP
- Iphone 16 Pro Max 256GB Black Titanium
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9800X3D 32/64GB DDR5 RAM RTX 5070 12GB GAMER termékbeszámítással
- ASTRO A50 WIRELESS HEADSET + BASE STATION 4th gen. fejhallgató
- Dell Latitude 5420 14" Touchscreen i5-1135G7 16GB 256GB 1 év garancia
- Dell Latitude Precision Üzleti gépek, 2-in-1 gépek, 3-13. gen.
- Apple iPhone 17 Pro Max 512GB / 36 hónap jótállással!
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: ATW Internet Kft.
Város: Budapest
ekkold

