Aniket Singh

Aniket Singh

|

@aniketxai

I’m a Full Stack Developer and IoT/Arduino Innovator. I build smart web apps and intelligent devices. On this site, I share coding tutorials, tech projects, and blogs related to web dev, embedded systems, and startup building.

🚀 View Projects
MERN Web Dev Arduino JavaScript Java DSA

Skills

HTML/CSS
JavaScript
React/MERN
IoT & Arduino

Writing First Pogram With Ardunio.

 Hello guys we understand First pogram in Ardunio.

Let start it:-



*Understanding Program Function

Void Setup () {

}

Void loop () {

}

•void-It is a command we declear function.
•setup-It is a function.
•loop-
It is a function.

*Understanding Program Structure

Void Setup () {

}

Void loop () {

}


Void setup code run be only one time in program.
void loop code run be repeteadly in linear pattern.


*Some Important Point
Every ardunio pogram has void setup () and void loop ().
Programs run in linear pattern.
Remember the {} curly bracket in program.
Program is case sensitive.
Use // to add comments in Program.
Put (;) after every statement.

*Some basic function

•pinMode()

= configure the specified pin to behave either as an input or output.

•syntax

pinMode (pin,mode);


pin-Ardunio pin

mode-INPUT/OUTPUT

example:-pinMode(13,OUTPUT);





•digitalWrite()

=Write a HIGH and LOW to a Digital Pin.

•syntax

digitalWrite(pin,value);

pin-Ardunio pin

value-HIGH/LOW

example:-digitalWrite(13,HIGH);



•delay()

=Pauses the pogram for the amount of time (in millisecond) specified as parametre (1sec=1000milisecond).


•syntax

delay(ms);

ms-the number of millisecond to pause.

example:-delay(1000);


*writing First program

void setup () {
 pinMode(12,OUTPUT);
}
void loop () {
digitalWrite(12,HIGH);
delay(1000);
digitalWrite(12,LOW);
delay(1000);
}

-connect digital pin 12  to 5mm 3v led and see what happen and comment.






Post a Comment