Arduino lab 1_1

9

Click here to load reader

description

Variant of first lab. How to generate a visual distress signal (what is popularly known as SOS)

Transcript of Arduino lab 1_1

Page 1: Arduino lab 1_1

Arduino Lab 1.1LED Pattern - SOS

Page 2: Arduino lab 1_1

Pre-requisiteArduino Lab 1.0

Same material, installation

Understanding of - setup, - loop, - output, - delay- digitalWrite,pinMode- High, Low

Page 3: Arduino lab 1_1

Setup

Define Pin 13 as LED

Set it as Output

Use a variable I#define LED 13int I;void setup(){ pinMode(LED,OUTPUT);}

Page 4: Arduino lab 1_1

Loop

Blink led for 3 times. Each blink is for 100 msec

Blink led for 3 times. Each blink is for 300 msec now.

Remain in loop

This is SOS dot-dot-dot-dash-dash-dash-dot-dot-dot......

Page 5: Arduino lab 1_1

void loop(){ for(I=0;I<3;++I) { digitalWrite(LED,HIGH); delay(100); digitalWrite(LED,LOW); delay(100); } for(I=0;I<3;++I) { digitalWrite(LED,HIGH); delay(500); digitalWrite(LED,LOW); delay(500); }}

Loop

Page 6: Arduino lab 1_1

LogicWell, part of the program is same as first except that it is executed only for 3 times

and then it moves to next step which is same except that delay is more and again repeated for three times

And then back to previous step

Result is morse code for SOS

Page 7: Arduino lab 1_1

Query

You hear Morse code for SMS almost every day for last so many years.

Guess where?

Page 8: Arduino lab 1_1

Contact MeHave more ideas, queries, suggestions?

Contact me at -

Vinay Chaddha

email : [email protected]

SMS : 9811074026

know more about me at visualcv.com/gvc3065