Who uses cold water?! Ugh. Adapting to an existing faucet, a recessed motion triggered sink starter to average temperature. Includes a photoresistor as a fail safe and Neopixels for a Pavlovian conditioning.
Updated: 288-021 Removed the light sensor as the motion sensor was adjusted to a minimum where it proved unlikely to randomly trigger. Replaced the light sensor with a momentary button as a power outage requisite reset to prevent errant servo reset (turning the sink on) upon powering without user awareness. If a power outage occurred, the entire unit is inactive and will flash red until the user presses the button.
// sink starter // vije miller // updated with button restore
#include "FastLED.h" #define NUM_LEDS 30 #define LED_TYPE WS2812B #define COLOR_ORDER GRB CRGB leds[NUM_LEDS]; #define PIN 16 int data = 255; int r = 0; int g = 0; int b = 255; int j = 0; int k = 0;
#include <VarSpeedServo.h> VarSpeedServo left; VarSpeedServo l_lift; VarSpeedServo right; VarSpeedServo r_lift; const int left_pin = 3; const int l_lift_pin = 5; const int right_pin = 7; const int r_lift_pin = 9;
const int rldown = 100; const int lldown = 80; const int rlup = 6; const int llup = 180; const int lup = 10; const int rup = 170; const int ldown_second = 92; const int rdown_second = 100;
const int button = 18; const int motion = 11; int ismoved;