- Megjött a Razer DeathAdder egerek legfrissebb nemzedéke
- Ismét minimalista miditorony érkezett a Fractal Design műhelyéből
- Alakul a SpaceX Starlink európai ellenfele
- Digital Fingerprinting: Így buktat le a böngésződ a neten - Tech Percek #18
- Prezentálta PCI Express 6.0-s SSD-vezérlőjét a Silicon Motion
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- A partnerektől függ, hogy lesz-e Arc csúcs-VGA az aktuális generációban
- OLED monitor topik
- Ha a fejlesztőkön múlik, akkor nem tér vissza a GPU-s PhysX
- Apple MacBook
- Milyen monitort vegyek?
- Bambu Lab 3D nyomtatók
- Épített vízhűtés (nem kompakt) topic
- Vezetékes FEJhallgatók
-
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
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Autós topik látogatók beszélgetős, offolós topikja
- sh4d0w: Csak a profit - emberélet nem számít
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- A partnerektől függ, hogy lesz-e Arc csúcs-VGA az aktuális generációban
- Redmi Note 10 Pro - majdnem minden stimmel
- Huawei Watch GT 3 Pro - korlátolt szépség
- Synology NAS
- Napelem
- OLED monitor topik
- További aktív témák...
- OHH! Dell Precision 7560 Tervező Vágó Laptop -70% 15,6" i7-11850H 32/1TB NVIDIA A3000 6GB FHD
- Asztali PC , i7 6700K , 1080 Ti 11GB , 32GB DDR4 , 500GB NVME , 500GB HDD
- Asztali PC , R5 8400F , RTX 3070 , 32GB DDR5 , 500GB NVME , 2TB HDD
- Legion Go 1TB
- Lenovo LOQ 15IRX9 - i5 13450HX, 16GB, RTX 4060 8G, 1TB M.2 (Gari: 2027.03.11.)
- BESZÁMÍTÁS! ASUS Z390 i5 9500 16GB DDR4 512GB SSD RTX 2060 Super 8GB Rampage SHIVA Thermaltake 500W
- ÁRGARANCIA! Épített KomPhone i5 13400F 32/64GB RAM RX 7700 XT 12GB GAMER PC termékbeszámítással
- HYNIX 2GB DDR3 RAM eladó
- 0% THM részletfizetés, beszámítás! Gamer PC, notebook, konzol, Apple termék, hardver KAMATMENTESEN!
- ÁRGARANCIA!Épített KomPhone i5 14600KF 32/64GB RAM RTX 5060 Ti 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest