LM311P (Voltage Comparator)

LM311P (Voltage Comparator)
  1. Arduino UNO
  2. LM311P
#define pinPower 9 void setup() { Serial.begin(9600); pinMode(pinPower, OUTPUT); } void loop() { int v = analogRead(A0); Serial.print("v: "); Serial.print(v); digitalWrite(pinPower, v < 1000); Serial.println(); }