Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

Basics of IF and Else statements (Arduino)

$
0
0
View attachment 36558

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

void setup() {
pinMode(10, OUTPUT);
pinMode(2, OUTPUT);
pinMode(12, INPUT);
pinMode(A0, INPUT);
}

void loop() {
analogWrite(10, analogRead(A0)/4);
if (12==HIGH)
{
digitalWrite(2, HIGH);
}
else
{
digitalWrite(2, LOW);
}
}...

Basics of IF and Else statements (Arduino)

Viewing all articles
Browse latest Browse all 1271

Trending Articles