Giter Site home page Giter Site logo

rheinturm's Issues

ledstrip.ino

https://github.com/MueThoS76/Rheinturm/blob/master/ledstrip.ino#L3
Hier würde ich definitiv mit Variablen arbeiten:

for (int i = LED_SEKUNDEN_EINER_MIN; i <= LED_SEKUNDEN_EINER_MAX; i++) {
    if (i - LED_SEKUNDEN_EINER_MIN < sekunden.einer) {

Das klappt dann bei allen anderen LEDs auch so.


https://github.com/MueThoS76/Rheinturm/blob/master/ledstrip.ino#L5
Hier solltest du zentral die Farben speichern:

// Im Hauptprogramm, ACHTUNG: ich weiß nicht ob `int` hier richtig ist.
int LED_ON  = PIXELS_CLOCK.Color(100,80,0);
int LED_OFF = PIXELS_CLOCK.Color(0,0,0);

// In ledstrip.ino
if (i - LED_SEKUNDEN_EINER_MIN < sekunden.einer) {
  PIXELS_CLOCK.setPixelColor(i, LED_ON);
} else {
  PIXELS_CLOCK.setPixelColor(i, LED_OFF);
}

uhr.ino

Rheinturm/uhr.ino

Lines 11 to 12 in fffa252

} while (((millis() - start) <= (1000 * sec)) && (timeinfo.tm_year < (2016 - 1900)));
if (timeinfo.tm_year <= (2016 - 1900)) return false; // the NTP call was not successful

Hier würde ich ein Makro schreiben, damit die Gültigkeitsprüfung auf die erhaltene Zeitinfo deutlich wird.

#define TIMEINFO_INVALID (timeinfo.tm_year <= (2016 - 1900))

Und dann:

} while (((millis() - start) <= (1000 * sec)) && TIMEINFO_INVALID);
if (TIMEINFO_INVALID) return false;  // the NTP call was not successful

sekunden.zehner = (timeinfo.tm_sec / 10) % 10;

Das würde ich explizit casten:

sekunden.zehner = (unsigned short)(timeinfo.tm_sec / 10);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.