Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sensorPin = A0; // select the input pin for the potentiometer
- int sensorValue = 0; // variable to store the value coming from the sensor
- void setup() {
- // put your setup code here, to run once:
- pinMode(7, OUTPUT);
- pinMode(6, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- sensorValue = analogRead(sensorPin);
- if(sensorValue > 1020){
- digitalWrite(6, HIGH);
- digitalWrite(7, HIGH);
- }else{
- digitalWrite(6, LOW);
- digitalWrite(7, LOW);
- }
- Serial.println(sensorValue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement