- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Elvette a PCI Express 5.0-t az egyes alaplapjaitól a Gigabyte
- Samsung Galaxy Tab tablet topik
- Októberben kerülnek legacy státuszba a régebbi GeForce VGA-k
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Azonnali informatikai kérdések órája
- Milyen egeret válasszak?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Lopakodva befutott a Radeon RX 9060
- Milyen Android TV boxot vegyek?
Hirdetés
Köszönjük a sok biztatást, támogatást! Utolsó pillanat a féláras hirdetésfeladásra, előfizetésre!
-
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
- A nagy Szóda, Szódakészítés topic - legyen egy kis fröccs is! :-)
- Budapest és környéke adok-veszek-beszélgetek
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Windows 11
- Egy óra, két rendszer
- Autós topik
- Autós topik látogatók beszélgetős, offolós topikja
- Meggyi001: RTX 5060 - Az új népkártya?
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Nintendo 3DS és DS topic
- További aktív témák...
- Call of Duty WW2 PS4 játék
- Eladó Konfig I5-10400F 32GB DDR4 256GB SSD 1TB HDD RX6600 8GB!
- Samsung Galaxy S24 Ultra 12/256gb - Karc mentes, akár beszámítással
- Samsung Galaxy S23 Ultra 12/512gb - Újszerű, akár beszámítással
- Apple iPhone 16 Pro 128gb - Szép állapot , Akku 100%, Apple garancia, akár beszámítással
- HP ZBook Firefly 14 i7-1165G7 32GB 1000GB 14" FHD magyarbill 1 év garancia
- Bomba ár! HP EliteBook Folio 1040 G1 - i5-G4 I 8GB I 256GB SSD I 14" HD+ I Cam I W10 I Garancia!
- HP EliteBook x360 830 G7 i5-10210U 16GB 256GB 13" FHD Áthajtós érintős 1 év garancia
- LG 34WQ75X-B - 34" Ívelt IPS Panel - 3440x1440 2K QHD - 60Hz 5ms - FreeSync - USB Type-C 90W
- Ritkaság! Hibátlan! Intel Core I9 13900KS Processzor!
Állásajánlatok
Cég: FOTC
Város: Budapest