I have a basic car alarm and i want to replace the blinking led with a attiny85 (or something similar) and a neopixel strip to run when the alarm is active. But the power to the factory led is not constant. It is a pulsed 5v, (5v hot for a couple seconds, then no power, then repeat) Is it possible to still use the pulsed voltage to trigger the attiny85 to run my code when the alarm is active and stop it when the alarm is deactivated? This is the code I wish to run
#include <Adafruit_NeoPixel.h> #define PIN D1 #define NUMPIXELS 11 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delay_time = 125; // 200 msec = 1/5th of a second void setup() { pixels.begin(); } void loop() { // from left to right for(int i=0; i<NUMPIXELS; i++){ pixels.setPixelColor(i, 0, 0, 255); pixels.show(); delay(delay_time); pixels.setPixelColor(i, 0, 0, 0); pixels.show(); } // from right to left for(int i=NUMPIXELS; i>0; i--){ pixels.setPixelColor(i, 0, 0, 255); pixels.show(); delay(delay_time); pixels.setPixelColor(i, 0, 0, 0); pixels.show(); } }