Hirdetés
- Jövő héten indul a Xiaomi kameraforradalma
- Csonkítás áldozata lett a nemzetközi Redmi Note 15 Pro+
- Nem rejtegetik tovább a Redmi Note 15 Pro és 15 Pro 5G globális verzióját sem
- Akciófigyelő: December 24-ig tart az Ulefone karácsonyi leárazása
- Bemutatta a Xiaomi a Redmi Note 15 és Note 15 5G globális változatát
- Nincs több titok a OnePlus 15R-t illetően, megjött Európába
- Vivo X300 - kicsiben jobban megéri
- Milyen hagyományos (nem okos-) telefont vegyek?
- One mobilszolgáltatások
- Milyen okostelefont vegyek?
- iPhone topik
- Samsung Galaxy Watch (Tizen és Wear OS) ingyenes számlapok, kupon kódok
- Külföldi prepaid SIM-ek itthon
- Samsung Galaxy S25 - végre van kicsi!
- Azonnali mobilos kérdések órája
-
Mobilarena
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
- Apple iPhone 13 Pro Max 128GB, Kártyafüggetlen, 1 Év Garanciával
- Apple iPhone 14 Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- BONTATLAN Új Iphone 15 és 15 Plus 128-512GB 1év APPLE garancia gyári független Deák AZONNAL Átvehető
- GAMER PC (Core i7-10700K UNLOCK / 16GB DDR4 / Gigabyte RTX 2060 6GB OC / 1TB SSD + 1TB HDD) garancia
- Dell Latitude 5540 15.6" FHD IPS i7-1365U 16GB 512GB NVMe ujjlolv gar
- ÚJ ASTRO A50 5th Gen LIGHTSPEED WIRELESS HEADSET + BASE STATION fejhallgató
- Xiaomi Redmi 13C 8/256 mint az új, garanciával eladó
- Bomba ár! Dell Latitude E5440 - i5-4GEN I 4GB I 320GB I 14" I HDMI I Cam I W10 I Gari!
- Intel Xeon E5-2600v4 processzorok készleten 2680v4,2683v4,2697v4,2697Av4(áfás számla, 2 év garancia)
- GYÖNYÖRŰ iPhone 13 Mini 128GB Pink-1 ÉV GARANCIA -Kártyafüggetlen, MS4173, 94% Akkumulátor
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
ekkold

