KyleShoesmith

Atelier 4.3 Swatch

Dec 13th, 2020
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int sensorPin = A0;    // select the input pin for the potentiometer
  2. int sensorValue = 0;  // variable to store the value coming from the sensor
  3.  
  4. void setup() {
  5.   // put your setup code here, to run once:
  6.   pinMode(7, OUTPUT);
  7.   pinMode(6, OUTPUT);
  8.   Serial.begin(9600);
  9.  
  10.  
  11. }
  12. void loop() {
  13.       sensorValue = analogRead(sensorPin);
  14.       if(sensorValue > 1020){
  15.         digitalWrite(6, HIGH);
  16.         digitalWrite(7, HIGH);
  17.       }else{
  18.         digitalWrite(6, LOW);
  19.         digitalWrite(7, LOW);
  20.       }
  21.       Serial.println(sensorValue);
  22.  
  23. }
RAW Paste Data