<commit_before>#include <Arduino.h>

#include <Adafruit_NeoPixel.h>
#include <Time.h>
#include <Wire.h>
#include <DS3232RTC.h>
#include "Button.h"

#define PIXEL_PIN   5    // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 22
#define BUTTON_PIN  4

class Nightlight
{
private:
  byte brightness;
  int8_t brightnessDelta;

public:
  Nightlight()
    : brightness(10)
    , brightnessDelta(1)
  {
  }

  void held()
  {
    if (brightnessDelta > 0 && brightness == 255) {
      brightnessDelta = -1;
    } else if (brightnessDelta < 0 && brightness == 0) {
      brightnessDelta = 1;
    }
    brightness += brightnessDelta;

    Serial.print("Brightness ");
    Serial.println(brightness);
  }

  void released()
  {
    brightnessDelta = -brightnessDelta;
  }

  void reset()
  {
    brightness = 0;
    brightnessDelta = 1;
  }

  uint32_t colour()
  {
    if (timeStatus() == timeSet) {
      const time_t t = now();
      if (hour(t) >= 6 && hour(t) < 19) {
        return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
      }
    }
<commit_msg>Change night time to 8pm-7am<commit_after>#include <Arduino.h>

#include <Adafruit_NeoPixel.h>
#include <Time.h>
#include <Wire.h>
#include <DS3232RTC.h>
#include "Button.h"

#define PIXEL_PIN   5    // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 22
#define BUTTON_PIN  4

class Nightlight
{
private:
  byte brightness;
  int8_t brightnessDelta;

public:
  Nightlight()
    : brightness(10)
    , brightnessDelta(1)
  {
  }

  void held()
  {
    if (brightnessDelta > 0 && brightness == 255) {
      brightnessDelta = -1;
    } else if (brightnessDelta < 0 && brightness == 0) {
      brightnessDelta = 1;
    }
    brightness += brightnessDelta;

    Serial.print("Brightness ");
    Serial.println(brightness);
  }

  void released()
  {
    brightnessDelta = -brightnessDelta;
  }

  void reset()
  {
    brightness = 0;
    brightnessDelta = 1;
  }

  uint32_t colour()
  {
    if (timeStatus() == timeSet) {
      const time_t t = now();
      if (hour(t) >= 7 && hour(t) < 20) {
        return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
      }
    }

{'fraction_non_alphanumeric': 0.1289875173370319, 'fraction_numerical': 0.027739251040221916, 'mean_word_length': 2.8505338078291813, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2676401', 'n_tokens_mistral': 856, 'n_tokens_neox': 764, 'n_words': 180}