Professional Documents
Culture Documents
BRANCH: ELN
DIVISION: C
OVERVIEW:
1. LED’s are light emmiting diodes. They are small, compact and easy to use.
2. The longer leg of led represent anode where as the short leg represent cathode.
SCHEMATIC DIAGRAM:
ARDUINO IDE CODE:
void setup ()
void loop() {
delay (1000);
delay (1000);
When you are using a pin as an O/P you can command it to high (output 5 volts) or low
(output
0 volts).
RESULT:
BRANCH: ELN
DIVISION: C
PRN NO:21410071
OVERVIEW:
SCHEMATIC DIAGRAM:
ARDUINO IDE CODE:
void setup(){
pinMode(10,OUTPUT);//red LED
pinMode(11,OUTPUT);//green LED
pinMode(12,OUTPUT);//blue LED
void loop() {
digitalWrite(10,HIGH);//red LED ON
delay(500);
delay(500);
digitalWrite(11,HIGH);//blue LED ON
delay(500);
delay(500);
digitalWrite(12,HIGH);//green LED ON
delay(500);
digitalWrite(12,LOW);//green LED ON
delay(500);
1. pinMode()
2. digitalWrite()
3. delay();
BRANCH: ELN
DIVISION: C
PRN NO:21410071
OVERVIEW:
SCHEMATIC DIAGRAM:
1.
void setup(){
Serial.begin(9600);
void loop(){
Serial.println(“Hello world”);
delay(1000);
2.
int value=0;
int led=13;
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
void loop() {
if(Serial.available()>0)
value=Serial.read();
delay(5);
if(value =='1'){
digitalWrite(led, HIGH);
Serial.println("LED is on");
if(value=='0'){
digitalWrite(led, LOW);
Serial.println("LED is off");
}
}
1. Serial.begin():
2. Serialprintln().
3. Serial.available():
RESULT: