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 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); }
|
|---|
