• Most regisztráltál, de nem tudsz privát üzenetet küldeni?

    Kérjük olvasd el milyen korlátozások vonatkoznak rád, miután regisztrációd jóvá lett hagyva.
    Regisztrációs korlátozások

Építsünk akváriumvezérlőt Arduino-ból

Megkérdezhetem hogy a kód melyik arduino ide verzióval készült, és milyen libaryk vannak telepítve?
Az aktuális 1.8.5-ös. Ehhez nem kell semmilyen extra lib.
Közben azt hiszem megtaláltam a problémát. Lehetséges, hogy valamiért más compilered van, ami szigorúbban kezel bizonyos dolgokat. Kicsit módosítottam a kódon, próbáld meg a csatolt változattal!
 

Attachments

  • AquaTimer.zip
    8.7 KB · Megtekintések: 24
Az aktuális 1.8.5-ös. Ehhez nem kell semmilyen extra lib.
Közben azt hiszem megtaláltam a problémát. Lehetséges, hogy valamiért más compilered van, ami szigorúbban kezel bizonyos dolgokat. Kicsit módosítottam a kódon, próbáld meg a csatolt változattal!
Üdv, megpróbáltam 1.8.5-ös változattal, aquatimer.zip cserélve de a hiba maradt, mellékelem:

C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino: In function 'void loop()':

sketch_dec26b:44: error: no matching function for call to 'AquaTimer::write()'

Micro.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:44:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec26b:45: error: no matching function for call to 'AquaTimer::write()'

Macro.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:45:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec26b:46: error: no matching function for call to 'AquaTimer::write()'

Carbo.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:46:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec26b:47: error: no matching function for call to 'AquaTimer::write()'

Phosphate.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:47:19: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec26b\sketch_dec26b.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

exit status 1
no matching function for call to 'AquaTimer::write()'
 
Szia @Kun Tamás ez már egy másik hiba. Azt mondja, hogy paraméterek nélkül hívod meg a write függvényt. Legalább egy DateTime típusú változót várna, amivel az aktuális időt átadod neki. Nézd meg a példa kódokat (pl a MultiTimert), ott pontosan megvan hogyan kell használni.
 
Szia @Kun Tamás ez már egy másik hiba. Azt mondja, hogy paraméterek nélkül hívod meg a write függvényt. Legalább egy DateTime típusú változót várna, amivel az aktuális időt átadod neki. Nézd meg a példa kódokat (pl a MultiTimert), ott pontosan megvan hogyan kell használni.
Üdv, bemásolom a kódot, a csomagok is a helyükön de ugyan az a helyzet, a multi timert néztem nem jövök rá mi a hiba.
 
Szia @Kun Tamás ez már egy másik hiba. Azt mondja, hogy paraméterek nélkül hívod meg a write függvényt. Legalább egy DateTime típusú változót várna, amivel az aktuális időt átadod neki. Nézd meg a példa kódokat (pl a MultiTimert), ott pontosan megvan hogyan kell használni.
Esetleg egy biztosan működő kódot nem tudsz adni, amit csak fel kell tölteni?
Az utolsó programból amit linkeltél.
 
Esetleg egy biztosan működő kódot nem tudsz adni, amit csak fel kell tölteni?
Az utolsó programból amit linkeltél.
Ez mind működik nálam. Arduinora és ESP8266-ra is lefordul. Szóval sajnos nem tudom mi lehet nálad a gond. Ha csak simán megnyitod bármelyik példakódot, azoknak hibátlanul le kellene fordulni. Nézd át, hogy biztosan csak az utoljára küldött változat legyen fent a gépeden a libekből, a többit töröld le. Próbáld lépésről lépésre összerakni a dolgot, folyamatosan ellenőrizve, hátha így kiderül, hogy mi romlik el.
 
Ez mind működik nálam. Arduinora és ESP8266-ra is lefordul. Szóval sajnos nem tudom mi lehet nálad a gond. Ha csak simán megnyitod bármelyik példakódot, azoknak hibátlanul le kellene fordulni. Nézd át, hogy biztosan csak az utoljára küldött változat legyen fent a gépeden a libekből, a többit töröld le. Próbáld lépésről lépésre összerakni a dolgot, folyamatosan ellenőrizve, hátha így kiderül, hogy mi romlik el.
Egyébként a csomagolt libeket megnyitva van egy __MACOSX mappa mindegyikben, ezt máshol még nem láttam, azt megkérdezhetem hogy milyen operációs rendszert használsz?
 
Valaki akinek Windows operációs rendszere van kipróbálná hogy nála működik a kód, bármit csinálok nálam semmi.
 
Valaki akinek Windows operációs rendszere van kipróbálná hogy nála működik a kód, bármit csinálok nálam semmi.
Lepróbáltak és nálam lefut a fordító, a Multitimer nevű programmal, igaz kellett egy kicsit szórakozni.
Én azt vettem észre, hogy nemigazán szereti a fordítóprogram, hogy ha csak kicsomagolod és simán bemásolod a ZIP-pelt programot a megfelelő könyvtárba. Ilyenkor szokott induláskor nyavalyogni, hogy ez vagy az a lib könyvtár nem használható. Ő azt szereti ha a Vázlat/Könyvtár tartalmazása/ .ZIP könyvtár hozzáadásával installálod hozzá, és ekkor megjelenik a File / Példák közt.
Amire nekem még ekkor is panaszkodott fordításkor az az RTC, valamiért nem tetszett neki a meglévő,de a program elején van egy link
https://github.com/adafruit/RTClib
azt innen kellett leszedni, szintén a zippelt verzióban és hasonlóan hozzáadni. ha reklamál esetleg, hogy már ilyen könyvtár létezik, akkor a meglévőt persze törölnöd kell, de vigyázz mert installáláskor a felhasználói profilod Documents könyvtárába is létrehoz egy Arduino könyvtárat és oda másol, tehát ha volt ilyened, akkor onnan is ki kell törölnöd a régit. Ez valószínűleg egy uninstallal sem törlődik ki.

Próbáltam, de nem jártam sikerrel.
Kíváncsiság kép azt is kipróbáltam, csak simán kimásoltam , de gond nélkül lefutott.
 
Utoljára módosított:
Valaki akinek Windows operációs rendszere van kipróbálná hogy nála működik a kód, bármit csinálok nálam semmi.
Szia Tamás!
A következőt csináltam:
- Feltelepítettem az 1.8.5-ös Arduino IDE-t egy windows gépre.
- Kinyitottam a Library Managert (Sketch / Include library / Magane Libraries)
- Rákerestem az RTClib szóra és feltelpítettem az RTClib by Adafruit kiegészítőt
- Utána ahogy Victor is írta Sketch / Include Library / Add .ZIP library hozzáadtam a fenti AquaTimer.zip libet
- Ekkor a File / Examples menü legaján megjelent az AquaTimer és alatta a 4 példaprogram. Innen kiválasztottam pl a MultiTimert
- Tools / Board / Arduino/Genuino Uno
- Lefordult:
Screenshot (1).png

Ha nálad valami nem stimmel, akkor valószínűleg összekeveredhettek fájlok, vagy rosszul települt fel valami.
A legbiztosabb, ha letörlsz mindent (feltéve, hogy nem írtál eddig sok kódot), és újratelepíted a rendszert a fenti módon.
A library-kat a windows Usered alatti Documents / Arduino könyvtárba pakolja a rendszer. Ezt is fontos törölni ha tiszta lappal akarsz indulni.
Ha esetleg írtál már kódot, amit érdemes megtartani, akkor ideiglenesen mozgasd ki az Arduino könyvtár alól!

A fejlesztői környezet fordításkor azt csinálja, hogy a inclue-olt libeket elkezdi megkeresni az ismert útvonalakon. Úgyhogy ha több verzió van egy libből a Documents/Arduino alatt, akkor előfordulhat, hogy rosszat választ. Ilynekor amúgy szólni is szokott, hogy több változatot talált. A legjobb a library managerrel kezelni, akkor valószínűleg nem lesz gond.
 
Üdv, multitimer lefordul, de feltöltve nem csinál semmit, soros porton sem látni semmit.
Ezt a kódot feltöltve ez fogad, pedig minden csomag telepítve van:

Kód beillesztése:
#include <RTClib.h>
#include <AutoSwitch.h>

#define WITH_DS3231
#include <AquaTimer.h>

RTC_DS3231 rtc;

const int LED_PIN = 6;
const int FILTER_PIN = 7;

// A világítás bekapcsoló gombja, egy óra után kikapcsolja magát
AutoSwitch LedButton(2, 3600);
// A szűrő stop etetéshez, ami 5 perc után újraindítja a szűrőt
AutoSwitch FilterStopButton(3, 300);

AquaTimer LedTimer;
AquaTimer Micro(8, "13:40:00", "13:40:04");
AquaTimer Macro(9, "13:40:20", "13:40:24");
AquaTimer Carbo(10, "13:40:40", "13:40:44");
AquaTimer Phosphate(11, "13:41:00", "13:41:04");

void setup() {
  pinMode(FILTER_PIN, OUTPUT);
  rtc.begin();
  if (rtc.lostPower()) {
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }

  // Világítás beállításai. A sok paraméter miatt metódus láncolással, hogy olvashatóbb legyen
  // A LED dimmeléséhez a PWM kimenet miatt relé helyett itt egy MOSFET-re lesz szükség!
  LedTimer
  .setPin(LED_PIN)
  .setOn("14:00")         // bekapcs
  .setTransition("30")    // átmenet ideje percben
  .setOff("22:00")        // kikapcs
  .setMoonDuration("60")  // holfény derengés ideje percben, a kikapcs után
  .setMaxVal("75%")       // a teljes fényerő dimmeléséhez. Ha 100% kellene, akkor elhagyható
  .setMoonVal(1);         // a holfény fényereje. Itt szándékosan van int, a lehető legkisebb fényerő kedvéért
}

void loop() {
  // Tápadagolók
  Micro.write();
  Macro.write();
  Carbo.write();
  Phosphate.write();

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);
}

hiba :
Arduino: 1.8.5 (Windows 10), Alaplap:"Arduino/Genuino Uno"

C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino: In function 'void loop()':

sketch_dec28a:44: error: no matching function for call to 'AquaTimer::write()'

Micro.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:44:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec28a:45: error: no matching function for call to 'AquaTimer::write()'

Macro.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:45:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec28a:46: error: no matching function for call to 'AquaTimer::write()'

Carbo.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:46:15: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

sketch_dec28a:47: error: no matching function for call to 'AquaTimer::write()'

Phosphate.write();

^

C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:47:19: note: candidate is:

In file included from C:\Users\tomi\Documents\Arduino\sketch_dec28a\sketch_dec28a.ino:5:0:

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: int AquaTimer::write(DateTime, bool)

int write(DateTime now, bool override = false);

^

C:\Users\tomi\Documents\Arduino\libraries\AquaTimer/AquaTimer.h:30:9: note: candidate expects 2 arguments, 0 provided

exit status 1
no matching function for call to 'AquaTimer::write()'
 
Ez kicsit off, de próbálok válaszolni rá: https://www.tinkercad.com/things/lTmmcYJC54R - bocsi azt hiszem csak úgy lehet elindítani, ha beregisztrál az ember.
A fel és le relék helyére a fenti tervben csak ledeket kötöttem, hogy látszódjon valami. A lényeg, hogy az alábbi kód szerintem megoldja, amit szeretnél:
Kód beillesztése:
int sensorPin = A0;  // ide van kötve a szenzor
int sensorValue = 0;  // ez az érték, amit kapunk róla
int state = 0;  // ez a változó, a redőny aktuális állapotát mutatja: 0-fent van, 1-mozog lefelé, 2-lent van, 3-mozog felfelé
long timer = 0;  // időzítő a mozgatáshoz
 
void setup() {
  Serial.begin(9600);
  pinMode(12, OUTPUT);  // ez az egyik irány
  pinMode(13, OUTPUT);  // ez a másik irány kimenete
  digitalWrite(12, LOW);
  digitalWrite(13, LOW);
}

void loop() {
  sensorValue = analogRead(sensorPin);  // beolvassuk a szenzor értékét
  //Serial.println(sensorValue);
  if (sensorValue > 1000 && state == 0) { // ha van fény, de a redőny fent van
    state = 1; // lefelé megy a redőny
    timer = millis();
    digitalWrite(12, HIGH);
    Serial.println("Indul lefele a redony");
  }
  if (state == 1 && millis() - timer >= 16000) { // letelt a 16 sec
    state = 2; // lent van
    digitalWrite(12, LOW);
    Serial.println("Kesz");
  }
  if (sensorValue < 1000 && state == 2) { // nincs már fény, de a redőny még lent van
    state = 3;
    timer = millis();
    digitalWrite(13, HIGH);
    Serial.println("Indul felfele a redony");
  }
  if (state == 3 && millis() - timer >= 16000) { // letelt a 16 sec
    state = 0; // fent van
    digitalWrite(13, LOW);
    Serial.println("Kesz");
  }
 
  delay(100);
}
ÜDV!
Köszönöm a kódot.
 
Kód beillesztése:
//Wemos Code :Másodperc kijelzés,dátum nincs


// TO GET OLED WORKING I NEEDED TO MAKE CHANGES SHOWN HERE
//  https://github.com/structure7/fridgeTemps
// OLED_RESET=0, etc and it works
// ON OLED/ESP12 pin D1 to SCL  and pin D2 to SDA


//************* Wol Clock by Jon Fuge ******************************
//  http://www.instructables.com/id/Wol-Clock-ESP8266-12E-60-LED-WS2812B-Analogue-Digi/?ALLSTEPS
//************* Declare included libraries ******************************
#include <NTPClient.h>
#include <Time.h>
#include <TimeLib.h>
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SSD1306_128_64
#define OLED_RESET 0
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define relay D7
//Set your timezone in hours difference rom GMT
const int hours_Offset_From_GMT = 0; //-5

//Set your wifi details so the board can connect and get the time from the internet
const char *ssid      = "***********";    //  your network SSID (name)
const char *password  = "*********"; // your network password

byte SetClock;

// By default 'time.nist.gov' is used.
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "hu.pool.ntp.org", 3600, 60000);

// Which pin on the ESP8266 is connected to the NeoPixels?
#define PIN            14 // This is the D5 pin

//************* Declare user functions ******************************
void Draw_Clock(time_t t, byte Phase);
int ClockCorrect(int Pixel);
void SetBrightness(time_t t);
void SetClockFromNTP ();
bool IsDst();

//************* Declare NeoPixel ******************************
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

//************* Setup function for Wol_Clock ******************************

#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup() {

  pinMode( relay,OUTPUT);
  WiFi.begin(ssid, password); // Try to connect to WiFi

  while ( WiFi.status() != WL_CONNECTED )
    delay ( 500 ); // keep waiging until we successfully connect to the WiFi

 SetClockFromNTP(); // get the time from the NTP server with timezone correction
 
  Wire.begin(4, 5);
  Serial.begin(9600);
 
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  display.clearDisplay();
  display.setTextSize(2.2);//2
  display.setTextColor(WHITE);
  display.setCursor(12, 9);  // over (X) then down (Y)...(12,9)
  display.println("Syncing V2");
  display.display();
}

void SetClockFromNTP ()
{
  timeClient.update(); // get the time from the NTP server
  setTime(timeClient.getEpochTime()); // Set the system yime from the clock
  if (IsDst())
    adjustTime((hours_Offset_From_GMT + 1) * 3600); // offset the system time with the user defined timezone (3600 seconds in an hour)
  else
    adjustTime(hours_Offset_From_GMT * 3600); // offset the system time with the user defined timezone (3600 seconds in an hour)
}

bool IsDst()
{
  if (month() < 3 || month() > 10)  return false;
  if (month() > 3 && month() < 10)  return true;
  int previousSunday = day() - weekday();
  if (month() == 3) return previousSunday >= 24;
  if (month() == 10) return previousSunday < 24;

  return false; // this line never gonna happend
}

//************* Main program loop for Wol_Clock ******************************
void loop() {



  time_t t = now(); // Get the current time
  SetBrightness(t);
  if (minute(t) == 0) // at the start of each hour, update the time from the time server
    if (SetClock == 1)
    {
      SetClockFromNTP(); // get the time from the NTP server with timezone correction
      SetClock = 0;
    }
    else
    {
      delay(200); // Just wait for 0.1 seconds
      SetClock = 1;
    }
}

//************* Function to set the clock brightness ******************************
void SetBrightness(time_t t)
{
  int NowHour = hour(t);
  int NowMinute = minute(t);
  int NowSecond = second(t);
  Serial.print("Hour = ");
  Serial.print(NowHour);
  Serial.print(" Minute= "); Serial.print(NowMinute);
  Serial.print(" Second= "); Serial.println(NowSecond);

  display.clearDisplay();

  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(12, 9);  // over (X) then down (Y)
  display.print(NowHour);
  display.print(":");
  if (NowMinute <= 9) {
    display.print("0");  // pad #s < 10 with leading zero
  }
  display.print(NowMinute);
  display.print(":");
  if (NowSecond <= 9) {  // pad #s < 10 with leading zero
    display.print("0");
  }
  display.print(NowSecond);

 
//***********************************---IDOZITESEK---*****
if(NowHour==19 && NowSecond==00) {
  digitalWrite(relay,HIGH);
}
 
  if(NowHour==19 && NowSecond==3) {
  digitalWrite(relay,LOW);
}
//********************************************************

 
   display.display();
  //***delay(1000);
}
https://drive.google.com/file/d/1HRzCLn5CSeyYTJEQY5LPOni2RbILGIzD/view?usp=sharing

Üdv!
Időzítéseket így is meg lehet oldani, nem kell óramodul csak wifi hálózat, NodeMCU (több lába van)vagy Wemos D1 mini. Még kijelző sem kell, soros portra is kiírja az időt.
Most például 19 órakor minden percben 0 és 3 másodperc között világít a led. Áramszünet után is visszaáll a pontos idő, NTP - ről veszi a jelet, hajszálpontosan együtt jár a laptopom órájával.
 
Utoljára módosított:
Üdv, multitimer lefordul, de feltöltve nem csinál semmit, soros porton sem látni semmit.
Ezt a kódot feltöltve ez fogad, pedig minden csomag telepítve van:

Kód beillesztése:
void loop() {
  // Tápadagolók
  Micro.write();
  Macro.write();
  Carbo.write();
  Phosphate.write();

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);
}
Így már érthető a probléma. Ha megnézed a multitimer kódját, ott egyáltalán nincs benne semmi Serial parancs, szóval nem csoda, hogy nem ír ki a soros portra semmit.
A kód, amit idézel sajnos egy korábbi verzióhoz való, közben kicsit változott a használata. Előtte nem kellett a write() függvénynek átadni az időt, de ezt árírtam, hogy egyszerűbb legyen a lib. Próbáld a loop()-ot lecserélni erre:
Kód beillesztése:
void loop() {
  DateTime now = rtc.now();
  // Tápadagolók
  Micro.write(now);
  Macro.write(now);
  Carbo.write(now);
  Phosphate.write(now);

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(now, buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);

  delay(200);
}
Ez a kód a fent megadott időpontokban fogja bekapcsolni a 8-9-10-11-es pineket, és nem működik a DS3231 nélkül.
 
Kód beillesztése:
//Wemos Code :Másodperc kijelzés,dátum nincs


// TO GET OLED WORKING I NEEDED TO MAKE CHANGES SHOWN HERE
//  https://github.com/structure7/fridgeTemps
// OLED_RESET=0, etc and it works
// ON OLED/ESP12 pin D1 to SCL  and pin D2 to SDA


//************* Wol Clock by Jon Fuge ******************************
//  http://www.instructables.com/id/Wol-Clock-ESP8266-12E-60-LED-WS2812B-Analogue-Digi/?ALLSTEPS
//************* Declare included libraries ******************************
#include <NTPClient.h>
#include <Time.h>
#include <TimeLib.h>
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SSD1306_128_64
#define OLED_RESET 0
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define relay D7
//Set your timezone in hours difference rom GMT
const int hours_Offset_From_GMT = 0; //-5

//Set your wifi details so the board can connect and get the time from the internet
const char *ssid      = "***********";    //  your network SSID (name)
const char *password  = "*********"; // your network password

byte SetClock;

// By default 'time.nist.gov' is used.
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "hu.pool.ntp.org", 3600, 60000);

// Which pin on the ESP8266 is connected to the NeoPixels?
#define PIN            14 // This is the D5 pin

//************* Declare user functions ******************************
void Draw_Clock(time_t t, byte Phase);
int ClockCorrect(int Pixel);
void SetBrightness(time_t t);
void SetClockFromNTP ();
bool IsDst();

//************* Declare NeoPixel ******************************
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

//************* Setup function for Wol_Clock ******************************

#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


void setup() {

  pinMode( relay,OUTPUT);
  WiFi.begin(ssid, password); // Try to connect to WiFi

  while ( WiFi.status() != WL_CONNECTED )
    delay ( 500 ); // keep waiging until we successfully connect to the WiFi

 SetClockFromNTP(); // get the time from the NTP server with timezone correction
 
  Wire.begin(4, 5);
  Serial.begin(9600);
 
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  display.clearDisplay();
  display.setTextSize(2.2);//2
  display.setTextColor(WHITE);
  display.setCursor(12, 9);  // over (X) then down (Y)...(12,9)
  display.println("Syncing V2");
  display.display();
}

void SetClockFromNTP ()
{
  timeClient.update(); // get the time from the NTP server
  setTime(timeClient.getEpochTime()); // Set the system yime from the clock
  if (IsDst())
    adjustTime((hours_Offset_From_GMT + 1) * 3600); // offset the system time with the user defined timezone (3600 seconds in an hour)
  else
    adjustTime(hours_Offset_From_GMT * 3600); // offset the system time with the user defined timezone (3600 seconds in an hour)
}

bool IsDst()
{
  if (month() < 3 || month() > 10)  return false;
  if (month() > 3 && month() < 10)  return true;
  int previousSunday = day() - weekday();
  if (month() == 3) return previousSunday >= 24;
  if (month() == 10) return previousSunday < 24;

  return false; // this line never gonna happend
}

//************* Main program loop for Wol_Clock ******************************
void loop() {



  time_t t = now(); // Get the current time
  SetBrightness(t);
  if (minute(t) == 0) // at the start of each hour, update the time from the time server
    if (SetClock == 1)
    {
      SetClockFromNTP(); // get the time from the NTP server with timezone correction
      SetClock = 0;
    }
    else
    {
      delay(200); // Just wait for 0.1 seconds
      SetClock = 1;
    }
}

//************* Function to set the clock brightness ******************************
void SetBrightness(time_t t)
{
  int NowHour = hour(t);
  int NowMinute = minute(t);
  int NowSecond = second(t);
  Serial.print("Hour = ");
  Serial.print(NowHour);
  Serial.print(" Minute= "); Serial.print(NowMinute);
  Serial.print(" Second= "); Serial.println(NowSecond);

  display.clearDisplay();

  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(12, 9);  // over (X) then down (Y)
  display.print(NowHour);
  display.print(":");
  if (NowMinute <= 9) {
    display.print("0");  // pad #s < 10 with leading zero
  }
  display.print(NowMinute);
  display.print(":");
  if (NowSecond <= 9) {  // pad #s < 10 with leading zero
    display.print("0");
  }
  display.print(NowSecond);

 
//***********************************---IDOZITESEK---*****
if(NowHour==19 && NowSecond==00) {
  digitalWrite(relay,HIGH);
}
 
  if(NowHour==19 && NowSecond==3) {
  digitalWrite(relay,LOW);
}
//********************************************************

 
   display.display();
  //***delay(1000);
}
https://drive.google.com/file/d/1HRzCLn5CSeyYTJEQY5LPOni2RbILGIzD/view?usp=sharing

Üdv!
Időzítéseket így is meg lehet oldani, nem kell óramodul csak wifi hálózat, NodeMCU (több lába van)vagy Wemos D1 mini. Még kijelző sem kell, soros portra is kiírja az időt.
Most például 19 órakor minden percben 0 és 3 másodperc között világít a led. Áramszünet után is visszaáll a pontos idő, NTP - ről veszi a jelet, hajszálpontosan együtt jár a laptopom órájával.
Ez egy jó kis kód, de én egy kicsit félek attól, hogy leáll a net (nálunk T-Home van, néha sajnos előfordul), vagy valamitől bedöglik a router, és akkor rossz esetben megállna az egész vezérlő is, ha nincs saját órája. Szóval igyekeztem úgy összerakni a rendszert, hogy önmagában is teljesen jól futhasson, a külső függőségek nélkül is.
 
Így már érthető a probléma. Ha megnézed a multitimer kódját, ott egyáltalán nincs benne semmi Serial parancs, szóval nem csoda, hogy nem ír ki a soros portra semmit.
A kód, amit idézel sajnos egy korábbi verzióhoz való, közben kicsit változott a használata. Előtte nem kellett a write() függvénynek átadni az időt, de ezt árírtam, hogy egyszerűbb legyen a lib. Próbáld a loop()-ot lecserélni erre:
Kód beillesztése:
void loop() {
  DateTime now = rtc.now();
  // Tápadagolók
  Micro.write(now);
  Macro.write(now);
  Carbo.write(now);
  Phosphate.write(now);

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(now, buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);

  delay(200);
}
Ez a kód a fent megadott időpontokban fogja bekapcsolni a 8-9-10-11-es pineket, és nem működik a DS3231 nélkül.
Üdv, lecseréltem az említett részt, most gond nélkül lefordul, és fel is tudom tölteni, viszont egyfolytában kapcsolja a pineket.

Kód beillesztése:
#include <RTClib.h>
#include <AutoSwitch.h>

#define WITH_DS3231
#include <AquaTimer.h>

RTC_DS3231 rtc;

const int LED_PIN = 6;
const int FILTER_PIN = 7;

// A világítás bekapcsoló gombja, egy óra után kikapcsolja magát
AutoSwitch LedButton(2, 3600);
// A szűrő stop etetéshez, ami 5 perc után újraindítja a szűrőt
AutoSwitch FilterStopButton(3, 300);

AquaTimer LedTimer;
AquaTimer Micro(8, "13:40:00", "13:40:04");
AquaTimer Macro(9, "13:40:20", "13:40:24");
AquaTimer Carbo(10, "13:40:40", "13:40:44");
AquaTimer Phosphate(11, "13:41:00", "13:41:04");

void setup() {
  pinMode(FILTER_PIN, OUTPUT);
  rtc.begin();
  if (rtc.lostPower()) {
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }

  // Világítás beállításai. A sok paraméter miatt metódus láncolással, hogy olvashatóbb legyen
  // A LED dimmeléséhez a PWM kimenet miatt relé helyett itt egy MOSFET-re lesz szükség!
  LedTimer
  .setPin(LED_PIN)
  .setOn("14:00")         // bekapcs
  .setTransition("30")    // átmenet ideje percben
  .setOff("22:00")        // kikapcs
  .setMoonDuration("60")  // holfény derengés ideje percben, a kikapcs után
  .setMaxVal("75%")       // a teljes fényerő dimmeléséhez. Ha 100% kellene, akkor elhagyható
  .setMoonVal(1);         // a holfény fényereje. Itt szándékosan van int, a lehető legkisebb fényerő kedvéért
}

void loop() {
  DateTime now = rtc.now();
  // Tápadagolók
  Micro.write(now);
  Macro.write(now);
  Carbo.write(now);
  Phosphate.write(now);

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(now, buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);

  delay(200);
}

telepített libek:
AquaTimer
AutoSwitch
DS3231
RTClib
 
Utoljára módosított:
Üdv, össze raktam magamnak egy kódot ami jó lenne nekem de nem kapcsol rendesen, segítenétek kijavítani?

Kód beillesztése:
#include <Wire.h>
#include <RTClib.h>
#include <Time.h>
#include <TimeAlarms.h>
 
RTC_DS1307 RTC;
 
// Start Time Light 1
int sHour = 06;
int sMinute = 40;
int sSecond = 0;

// Start Time Light 2
int s2Hour = 07;
int s2Minute = 00;
int s2Second = 00;

// Start Time Light 3
int s3Hour = 07;
int s3Minute = 20;
int s3Second = 00;

// Start Time Light 4
int s4Hour = 07;
int s4Minute = 40;
int s4Second = 00;

// Start Time Light 5
int s5Hour = 07;
int s5Minute = 00;
int s5Second = 00;

// Start Time Light 6
int s6Hour = 07;
int s6Minute = 20;
int s6Second = 24;

// End Time Light 1
int eHour = 17;
int eMinute = 40;
int eSecond = 00;

// End Time Light 2
int e2Hour = 18;
int e2Minute = 00;
int e2Second = 00;

// End Time Light 3
int e3Hour = 18;
int e3Minute = 20;
int e3Second = 00;

// End Time Light 4
int e4Hour = 18;
int e4Minute = 40;
int e4Second = 00;

// End Time Light 5
int e5Hour = 19;
int e5Minute = 00;
int e5Second = 00;

// End Time Light 6
int e6Hour = 19;
int e6Minute = 20;
int e6Second = 00;
 
int lightRelay1 = 9;
int lightRelay2 = 2;
int lightRelay3 = 3;
int lightRelay4 = 4;
int lightRelay5 = 5;
int lightRelay6 = 6;

void setup() {
  // Set the relay to off immediately
  digitalWrite(lightRelay1, HIGH);
  digitalWrite(lightRelay2, HIGH);
  digitalWrite(lightRelay3, HIGH);
  digitalWrite(lightRelay4, HIGH);
  digitalWrite(lightRelay5, HIGH);
  digitalWrite(lightRelay6, HIGH);
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  
  // Set the pinmode
  pinMode(lightRelay1, OUTPUT);
  pinMode(lightRelay2, OUTPUT);
  pinMode(lightRelay3, OUTPUT);
  pinMode(lightRelay4, OUTPUT);
  pinMode(lightRelay5, OUTPUT);
  pinMode(lightRelay6, 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 time1
  setTime(sHour, sMinute, sSecond, current.day(), current.month(), current.year());
  time_t s = now();
 
   // Use RTC time to set the start time2
  setTime(s2Hour, s2Minute, s2Second, current.day(), current.month(), current.year());
  time_t s2 = now();
 
   // Use RTC time to set the start time3
  setTime(s3Hour, s3Minute, s3Second, current.day(), current.month(), current.year());
  time_t s3 = now();
 
   // Use RTC time to set the start time4
  setTime(s4Hour, s4Minute, s4Second, current.day(), current.month(), current.year());
  time_t s4 = now();
 
   // Use RTC time to set the start time5
  setTime(s5Hour, s5Minute, s5Second, current.day(), current.month(), current.year());
  time_t s5 = now();
 
   // Use RTC time to set the start time6
  setTime(s6Hour, s6Minute, s6Second, current.day(), current.month(), current.year());
  time_t s6 = now();
 
   // Use RTC time to set the end time1
  setTime(eHour, eMinute, eSecond, current.day(), current.month(), current.year());
  time_t e = now();
 
   // Use RTC time to set the end time2
  setTime(e2Hour, e2Minute, e2Second, current.day(), current.month(), current.year());
  time_t e2 = now();
 
   // Use RTC time to set the end time3
  setTime(e3Hour, e3Minute, e3Second, current.day(), current.month(), current.year());
  time_t e3 = now();
 
   // Use RTC time to set the end time4
  setTime(e4Hour, e4Minute, e4Second, current.day(), current.month(), current.year());
  time_t e4 = now();
 
   // Use RTC time to set the end time5
  setTime(e5Hour, e5Minute, e5Second, current.day(), current.month(), current.year());
  time_t e5 = now();
 
   // Use RTC time to set the end time6
  setTime(e6Hour, e6Minute, e6Second, current.day(), current.month(), current.year());
  time_t e6 = 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(lightRelay1, LOW);  // Sets the grow light "on"
  }
  if (s2 <= n && n <= e2) {
    digitalWrite(lightRelay2, LOW);  // Sets the grow light "on"
  }
  if (s3 <= n && n <= e3) {
    digitalWrite(lightRelay3, LOW);  // Sets the grow light "on"
  }
  if (s4 <= n && n <= e4) {
    digitalWrite(lightRelay4, LOW);  // Sets the grow light "on"
  }
  if (s5 <= n && n <= e5) {
    digitalWrite(lightRelay5, LOW);  // Sets the grow light "on"
  }
  if (s6 <= n && n <= e6) {
    digitalWrite(lightRelay6, LOW);  // Sets the grow light "on"
  }
  Alarm.alarmRepeat(sHour, sMinute, sSecond, Light1On);
  Alarm.alarmRepeat(eHour, eMinute, eSecond, Light1Off);
  Alarm.alarmRepeat(s2Hour, s2Minute, s2Second, Light2On);
  Alarm.alarmRepeat(e2Hour, e2Minute, e2Second, Light2Off);
  Alarm.alarmRepeat(s3Hour, s3Minute, s3Second, Light3On);
  Alarm.alarmRepeat(e3Hour, e3Minute, e3Second, Light3Off);
  Alarm.alarmRepeat(s4Hour, s4Minute, s4Second, Light4On);
  Alarm.alarmRepeat(e4Hour, e4Minute, e4Second, Light4Off);
  Alarm.alarmRepeat(s5Hour, s5Minute, s5Second, Light5On);
  Alarm.alarmRepeat(e5Hour, e5Minute, e5Second, Light5Off);
  Alarm.alarmRepeat(s6Hour, s6Minute, s6Second, Light6On);
  Alarm.alarmRepeat(e6Hour, e6Minute, e6Second, Light6Off);
}
 
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(600000);
}
void Light1On() {
  Serial.println("Turning Light 1 On");
  digitalWrite(lightRelay1, LOW);
}
void Light1Off() {
  Serial.println("Turning Light 1 Off");
  digitalWrite(lightRelay1, HIGH);
}
 void Light2On() {
  Serial.println("Turning Light 2 On");
  digitalWrite(lightRelay2, LOW);
}
void Light2Off() {
  Serial.println("Turning Light 2 Off");
  digitalWrite(lightRelay2, HIGH);
}
 void Light3On() {
  Serial.println("Turning Light 3 On");
  digitalWrite(lightRelay3, LOW);
}
void Light3Off() {
  Serial.println("Turning Light 3 Off");
  digitalWrite(lightRelay3, HIGH);
}
 void Light4On() {
  Serial.println("Turning Light 4 On");
  digitalWrite(lightRelay4, LOW);
}
void Light4Off() {
  Serial.println("Turning Light 4 Off");
  digitalWrite(lightRelay4, HIGH);
}
 void Light5On() {
  Serial.println("Turning Light 5 On");
  digitalWrite(lightRelay5, LOW);
}
void Light5Off() {
  Serial.println("Turning Light 5 Off");
  digitalWrite(lightRelay5, HIGH);
}
 void Light6On() {
  Serial.println("Turning Light 6 On");
  digitalWrite(lightRelay6, LOW);
}
void Light6Off() {
  Serial.println("Turning Light 6 Off");
  digitalWrite(lightRelay6, HIGH);
}
 
Üdv, össze raktam magamnak egy kódot ami jó lenne nekem de nem kapcsol rendesen, segítenétek kijavítani?
}[/CODE]

Szia!
Olvasom a küzdelmed, de nem igazán értelek... A teljes kódot jótékonyságból nem fogja megíri neked senki szerintem, de már rengeteg segítséget kaptál itt, a prohardver és az index fórumon is. Ha kicsit visszaolvasol, itt is találsz működő kódokat és kódrészleteket, melyek a Te jelenlegi igényednek bőven megfelelnek. Ezt ne vedd kioktatásnak kérlek, nem annak szántam... Olvasni , próbálni, küzdeni....

Szóval a legegyszerűbben úgy tudod kapcsolgatni a reléidet, hogy bevezetsz egy új "int" változót "eltelt_percek", amivel az aktuális nap eltelt perceit számolod (esetleg még egyet - ha másodperc alapú kapcsolás is kell - az órán belüli másodperceknek "eltelt_m.percek"). Ehhez viszonyítod a tervezett kapcsolásaid.

Lekérdezed az RTC-t és a kapott óra és perc változókból legenerálod a saját változódat:
eltelt_percek = (ora * 60) + perc;
eltelt_mpercek = (perc * 60) + mperc;
Ennek egy hátrányát van csupán: éjfélkor nullázódnak, tehát nem érdemes úgy kapcsolni semmit, hogy aktív kapcsolási időd legyen éjfélkor.

Ha ennek megértetted a logikáját, akkor innen már könnyű dolgod van, pld:
vil_be = vilbeora * 60 + vilbeperc; // alap világítás bekapcsolásának számítása
vil_ki = vilkiora * 60 + vilkiperc; // alap világítás kikapcsolásának számítása

if ((eltelt_percek >= vil_be) && (eltelt_percek < vil_ki) || (szuro_allapot == false)) { // belkapcsol a vil_relé ha a megadott időn belül van vagy ha a szürő leállt
digitalWrite(vil_rele, HIGH); // világítás bekapcsolása
vilagitas_allapot = true; // világítás állapotjelző
}
else {
digitalWrite(vil_rele, LOW);
vilagitas_allapot = false;
}

Másodperc alapon lévő kapcsolásnál egy percen belül tudsz kapcsolni, pld:
pumpa1_be = tapbeperc * 60; // bekapcsolás értéke másodpercben
pumpa1_ki = pumpa1_be + micro; // kikapcsolás másodpercben
if ((eltelt_percek >= (tapbeora * 60) + tapbeperc) && (eltelt_percek < (tapbeora * 60) + tapbeperc + 5)) { // tap_be után 5 percig figyel (max 300mp lehet a leghosszabb tápidő)
//Micro vezérlés (napi egyszer)
if ((eltelt_mpercek >= pumpa1_be) && (eltelt_mpercek < pumpa1_ki)) {
digitalWrite(pumpa1_rele, HIGH);
Micro_allapot = true;
}
else {
digitalWrite(pumpa1_rele, LOW);
Micro_allapot = false;
}

Remélem segítettem valamit. Egyébként ehhez hasonót írtak Neked a prohardveren is!
 
Utoljára módosított:
Üdv, lecseréltem az említett részt, most gond nélkül lefordul, és fel is tudom tölteni, viszont egyfolytában kapcsolja a pineket.

Kód beillesztése:
#include <RTClib.h>
#include <AutoSwitch.h>

#define WITH_DS3231
#include <AquaTimer.h>

RTC_DS3231 rtc;

const int LED_PIN = 6;
const int FILTER_PIN = 7;

// A világítás bekapcsoló gombja, egy óra után kikapcsolja magát
AutoSwitch LedButton(2, 3600);
// A szűrő stop etetéshez, ami 5 perc után újraindítja a szűrőt
AutoSwitch FilterStopButton(3, 300);

AquaTimer LedTimer;
AquaTimer Micro(8, "13:40:00", "13:40:04");
AquaTimer Macro(9, "13:40:20", "13:40:24");
AquaTimer Carbo(10, "13:40:40", "13:40:44");
AquaTimer Phosphate(11, "13:41:00", "13:41:04");

void setup() {
  pinMode(FILTER_PIN, OUTPUT);
  rtc.begin();
  if (rtc.lostPower()) {
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }

  // Világítás beállításai. A sok paraméter miatt metódus láncolással, hogy olvashatóbb legyen
  // A LED dimmeléséhez a PWM kimenet miatt relé helyett itt egy MOSFET-re lesz szükség!
  LedTimer
  .setPin(LED_PIN)
  .setOn("14:00")         // bekapcs
  .setTransition("30")    // átmenet ideje percben
  .setOff("22:00")        // kikapcs
  .setMoonDuration("60")  // holfény derengés ideje percben, a kikapcs után
  .setMaxVal("75%")       // a teljes fényerő dimmeléséhez. Ha 100% kellene, akkor elhagyható
  .setMoonVal(1);         // a holfény fényereje. Itt szándékosan van int, a lehető legkisebb fényerő kedvéért
}

void loop() {
  DateTime now = rtc.now();
  // Tápadagolók
  Micro.write(now);
  Macro.write(now);
  Carbo.write(now);
  Phosphate.write(now);

  // Világítás a teljes fényerő gombbal
  int buttonState = LedButton.getState();
  LedTimer.write(now, buttonState);

  // Szűrő stop -  a relén a NC (Normally Closed) kimenetre érdemes kötni a szűrő konnektorát
  int filterStopState = FilterStopButton.getState();
  digitalWrite(FILTER_PIN, filterStopState);

  delay(200);
}

telepített libek:
AquaTimer
AutoSwitch
DS3231
RTClib

Bekötötted a kapcsolót vagy csak úgy futtatad az üres vezérlőn a kódot? Ha más kódját akarod használni, akkor az összes pin-t úgy kösd be (kapcsolókat, felhúzó ellenálásokat), ahogy az eredeti szerzőnél volt és csak akkor változtass, ha elég ügyes vagy... A lebegő lábak meglepetéseket okozhatnak!
Figyelmeztetlek előre, hogy az index fórumon megosztott kódnál is lesre futhatsz, ugyanis a kolléga Due-t használ és ott más pinekre van kötve a DS3231 RTC modul, mint ahogy mondjuk az uno és a mega esetében szokás. Itt kell változtatnod ha azzal próbálkozol: DS3231 rtc(SDA, SCL) - lásd: http://www.instructables.com/id/Real-time-clock-using-DS3231-EASY/ 3. lépés;
Az arduino elsősorban a tanulásról szól.....
Az előző hozzászólásomban a programrészletekben láthattad, hogy "állapotok" beállításával sokkal áttekinthetőbben lehet kezelni az egyes folyamatokat. A saját kódodban is ajánlom az alkalmazásukat.
De most már a saját vezérlőmmel foglalkozom, mivel én is csak tanulgatom a programozást és éves csúszásban vagyok....
Hurrá, ez volt az 1000. bejegyzés! :)
 
Utoljára módosított:
Back
Oldal tetejére