From 66877a54b1fe1b8e8e53f57ff1307edc745d7e6f Mon Sep 17 00:00:00 2001 From: nilo Date: Sat, 31 Oct 2020 12:39:34 +0100 Subject: [PATCH] add led --- ebk_co2ampel/ebk_co2ampel.ino | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ebk_co2ampel/ebk_co2ampel.ino b/ebk_co2ampel/ebk_co2ampel.ino index a286c23..817a192 100644 --- a/ebk_co2ampel/ebk_co2ampel.ino +++ b/ebk_co2ampel/ebk_co2ampel.ino @@ -1,6 +1,9 @@ #include #include "MHZ19.h" #include "SSD1306Wire.h" + +#include + #define RX_PIN 16 #define TX_PIN 17 #define BAUDRATE 9600 @@ -10,6 +13,11 @@ MHZ19 myMHZ19; HardwareSerial mySerial(1); SSD1306Wire display(0x3c, 21, 22); +// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. +// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest +Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, 4, NEO_GRB + NEO_KHZ800); + + unsigned long getDataTimer = 0; int lastvals[120]; int dheight; @@ -29,7 +37,9 @@ void setup() for (int x; x <= 119; x = x + 1) { lastvals[x] = -1; } - +pixels.begin(); // This initializes the NeoPixel library. +pixels.setPixelColor(0, pixels.Color(255,0,0)); // Moderately bright green color. +pixels.show(); }