Go Down

Topic: Neuling hat ne Frage Projekt Leuchtturm-Karte (Read 7003 times) previous topic - next topic


jack48

Hallo,

hatte das Problem, dass ich Zeiten über 30 sek verwenden wollte. Daher die Anfrage an Hr. Klein bzgl. seines Sketches. Daher die Änderung von
Code: [Select]
static uint16_t phase = setOutput(led); in
Code: [Select]
static uint32_t phase = setOutput(led);
Code: [Select]
uint8_t setOutput(uint8_t pin) {
  pinMode(pin, OUTPUT);
  return 0;
}

template <uint8_t rel, uint32_t d1, uint32_t d2, uint16_t d3, uint16_t d4,
          uint16_t d5, uint16_t d6, uint16_t d7, uint16_t d8>


void timer() {
  static uint32_t phase = setOutput(rel);

  phase = phase < d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 - 1 ? phase + 1 : 0;

  digitalWrite(rel, phase < d1                  ? LOW :
               phase < d1 + d2               ? HIGH :
               phase < d1 + d2 + d3            ? LOW :
               phase < d1 + d2 + d3 + d4         ? HIGH :
               phase < d1 + d2 + d3 + d4 + d5      ? LOW :
               phase < d1 + d2 + d3 + d4 + d5 + d6   ? HIGH :
               phase < d1 + d2 + d3 + d4 + d5 + d6 + d7 ? LOW :
               HIGH);
}

void blink() {
  timer<abl, 60000, 300000, 0, 0, 0, 0, 0, 0>(); }


Vielen Dank für die Hilfe!
mfg
Robert

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy