- Milyen RAM-ot vegyek?
- Milyen TV-t vegyek?
- A partnerektől függ, hogy lesz-e Arc csúcs-VGA az aktuális generációban
- TCL LCD és LED TV-k
- Milyen egeret válasszak?
- SSD kibeszélő
- OLED TV topic
- Milyen cserélhető objektíves gépet?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- AMD Navi Radeon™ RX 9xxx sorozat
-
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
- iPhone 12 64GB - fehér Garanciális 2026.01.07
- szinte új HP E24m G4 full HD 1920x1080 IPS monitor- rejtett Webkamera - nagy hangszóró - USB-C
- NEC MultiSync EA275WMi 27" képátló/ AH-IPS panel/2560x1440 (WQHD)/ A- kategória nagyon apró hibával!
- új aktiválatlan iPhone 16 128GB black fekete független 1 év Apple garancia
- szinte új iPhone 16 Pro 256GB black titanium fekete titán független Apple 3 év garancia adapter
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9800X3D 32/64GB RAM RX 9070 XT 16GB GAMER PC termékbeszámítással
- Beszámítás! Apple Mac Studio M2 MAX 2023 32GB 512GB SSD számítógép garanciával, hibátlan működéssel
- Honor 90 256GB, Kártyafüggetlen, 1 Év Garanciával
- Új, verhetetlen alaplap sok extrával!
- Bomba ár! HP EliteBook 830 G7 - i7-10GEN I 16GB I 512GB SSD I HDMI I 13,3" FHD I Cam I W11 I Gari!
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Promenade Publishing House Kft.
Város: Budapest