Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
542 B
3
Indexable
Never
int deger;
void setup() {
  pinMode(9,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);
  
  Serial.begin(9600);

}

void loop() {
  Serial.println(deger);
  delay(500);
 deger = analogRead(A0);
 
if(deger >=0&&deger <255)
{digitalWrite(9,1);}
else
digitalWrite(9,0);
if (deger >255 && deger<510)
digitalWrite(8,1);
else
{digitalWrite(8,0);}
if(deger>510&&deger<765)
digitalWrite(10,1);
else
digitalWrite(10,0);
if (deger>765&&deger<=1023)
digitalWrite(11,1);
else
digitalWrite(11,0);
}