Episode 24- Basics of Arduino i++ and i-- (Malayalam)
Circuit

The code
Circuit

The code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pin; | |
const int tym=50; | |
void setup() { | |
pinMode(1,OUTPUT); | |
pinMode(2,OUTPUT); | |
pinMode(3,OUTPUT); | |
pinMode(4,OUTPUT); | |
pinMode(5,OUTPUT); | |
pinMode(6,OUTPUT); | |
pinMode(7,OUTPUT); | |
pinMode(8,OUTPUT); | |
pinMode(9,OUTPUT); | |
pinMode(10,OUTPUT); | |
digitalWrite(1,LOW); | |
digitalWrite(2,LOW); | |
digitalWrite(3,LOW); | |
digitalWrite(4,LOW); | |
digitalWrite(5,LOW); | |
digitalWrite(6,LOW); | |
digitalWrite(7,LOW); | |
digitalWrite(8,LOW); | |
digitalWrite(9,LOW); | |
digitalWrite(10,LOW); | |
} | |
void loop() { | |
for(pin=1;pin<=10;pin++) | |
{ | |
digitalWrite(pin,HIGH); | |
delay(tym); | |
digitalWrite(pin,LOW); | |
delay(tym); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(pin=10;pin>=1;pin--) | |
{ | |
digitalWrite(pin,HIGH); | |
delay(tym); | |
digitalWrite(pin,LOW); | |
delay(tym); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(pin=10;pin>=1;pin/=3) | |
{ | |
digitalWrite(pin,HIGH); | |
delay(tym); | |
digitalWrite(pin,LOW); | |
delay(tym); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(pin=1;pin<=10;pin+=2) | |
{ | |
digitalWrite(pin,HIGH); | |
delay(tym); | |
digitalWrite(pin,LOW); | |
delay(tym); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(pin=1;pin<=10;pin*=3) | |
{ | |
digitalWrite(pin,HIGH); | |
delay(tym); | |
digitalWrite(pin,LOW); | |
delay(tym); | |
} |