Arduino lab 1_1
Click here to load reader
-
Upload
openembedded -
Category
Self Improvement
-
view
578 -
download
4
description
Transcript of Arduino lab 1_1
![Page 1: Arduino lab 1_1](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/1.jpg)
Arduino Lab 1.1LED Pattern - SOS
![Page 2: Arduino lab 1_1](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/2.jpg)
Pre-requisiteArduino Lab 1.0
Same material, installation
Understanding of - setup, - loop, - output, - delay- digitalWrite,pinMode- High, Low
![Page 3: Arduino lab 1_1](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/3.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/4.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/5.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/6.jpg)
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](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/7.jpg)
Query
You hear Morse code for SMS almost every day for last so many years.
Guess where?
![Page 8: Arduino lab 1_1](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/8.jpg)
Contact MeHave more ideas, queries, suggestions?
Contact me at -
Vinay Chaddha
email : [email protected]
SMS : 9811074026
know more about me at visualcv.com/gvc3065
![Page 9: Arduino lab 1_1](https://reader038.fdocuments.in/reader038/viewer/2022100600/5554b249b4c90559398b4576/html5/thumbnails/9.jpg)
Check us online
Join our facebook page at facebook.com/open.embedded
Buy products from myworld.ebay.in/open.embedded