Hirdetés
- Internet Rádió építése (hardver), és programozása
- SSD kibeszélő
- Intel Core i3 / i5 / i7 / i9 10xxx "Comet Lake" és i3 / i5 / i7 / i9 11xxx "Rocket Lake" (LGA1200)
- Bluetooth hangszórók
- Philips LCD és LED TV-k
- AMD Navi Radeon™ RX 9xxx sorozat
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Melyik tápegységet vegyem?
- Intel Core Ultra 3, Core Ultra 5, Ultra 7, Ultra 9 "Arrow Lake" LGA 1851
- Házimozi haladó szinten
-
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
// 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;
int lightRelay2 = 3;
int lightRelay3 = 4;
int lightRelay4 = 5;
int lightRelay5 = 6;
int lightRelay6 = 7;
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);
}Csak annyit szeretnék hogy a hat relét adott időben be majd ki kapcsolni külön külön
Új hozzászólás Aktív témák
- Internet Rádió építése (hardver), és programozása
- Futás, futópályák
- Szívós, szép és kitartó az új OnePlus óra
- SSD kibeszélő
- Elektromos cigaretta 🔞
- Intel Core i3 / i5 / i7 / i9 10xxx "Comet Lake" és i3 / i5 / i7 / i9 11xxx "Rocket Lake" (LGA1200)
- Íme, a Moto X70 Air, vagyis Motorola Edge 70 minden oldalról
- Bluetooth hangszórók
- Philips LCD és LED TV-k
- Videó stream letöltése
- További aktív témák...
- Kezdő Gamer PC-Számítógép!Csere-Beszámítás! I5 6500 / RX580 8GB / 16GB DDR4 / 512 SSD
- Apple watch Ultra 2 titanium Milanese 2026.03.23. Apple jótállás
- MSI Cyborg 15 A13VFK 15.6" FHD IPS i7-13620H RTX 4060 16GB 512GB NVMe magyar vbill gar
- Eladó egy bontatlan Google Pixel 10 128GB Obsidian (fekete) okostelefon, ajándék eredeti tokkal
- Bomba ár! Dell Latitude 7212 Rugged Extreme - i7-8G I 16GB I 256SSD I 11,6" FHD I Cam I W11 I Gari!
- GYÖNYÖRŰ iPhone 13 Pro 256GB Sierra Blue - 1 ÉV GARANCIA, Kártyafüggetlen, 100% Akkumulátor,MS3409
- Prémium PC házak akár 20-40% kedvezménnyel eladók garanciával, számlával! Upd. 10.06
- HIBÁTLAN iPhone 13 Pro 128GB Alphine Green -1 ÉV GARANCIA - Kártyafüggetlen, MS3024, 91% Akkumulátor
- Gamer PC-Számítógép! Csere-Beszámítás! I7 6700K / RTX 2060 6GB / 32GB DDR4 / 500 SSD
- Apple iPhone 13 Pro Max 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest