Hello.
Here is my current “installation”.
My 2 door sensors send 1 or 0 if there is contact.
Depending on the result, LEDs 1 and 2 light up red or green.
What I would like is to replace the leds with a logo on the mirror.
(I have a door on the street side and a door on the garden side which explains the logos)
Here is the code of my Arduino project.
#include
const int C_buttonPin = 12; // Door 1
const int H_buttonPin = 13; // Door 2
const int ledsPin = 2;
const int nombreLeds = 2;
const int intervalleTemps = 200;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(nombreLeds, ledsPin);
int C_buttonState = 0; // Etat actuel Door 1
int H_buttonState = 0; // Etat actuel Door 2
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
pixels.begin();
pixels.show();
}
// the loop routine runs over and over again forever:
void loop() {
int sensorValC = digitalRead(12); Serial.println(sensorValC);
int sensorValH = digitalRead(13); Serial.println(sensorValH);
if (sensorValC == 1)
{
pixels.setPixelColor(0, 255,0,0);
}
else
{
pixels.setPixelColor(0, 124,252,0);
}
if (sensorValH == 1)
{
pixels.setPixelColor(1, 255,0,0);
}
else
{
pixels.setPixelColor(1, 124,252,0);
}
pixels.show();
delay(intervalleTemps);
}
Ho and sorry for my bad english (i’m from Belgium)