This Is a Basic Program for a Beginner

1,325

14

3

Posted in TechnologyLeds

Introduction: This Is a Basic Program for a Beginner

This is a basic program for a beginner

Step 1:  Step 1 :

  1. first of the you can go on this practical before do remember this things what you need in this practical. You need some led , wire , breadboard and arduino.

Step 2: Step 2 :

  1. Now, you can go on proper arrangement with some wire and led. This led inserted on breadboard in proper way and next connect arduino by connect usb cable through your pc or leptop.

Step 3: Step 3 :

Now,

you should install arduino software in your pc or lepto[pe . if you have good knowledge about c program then you can make it otherwise you can go on my program which I made it . which is program loopiteration and arrays.

Forloopitration

int timer = 1000;

void setup() {

for (int APin = 2; APin < 7; APin++) {

pinMode(APin, OUTPUT);

Serial.begin(9600);

}

}

voidloop() {

for (int APin = 2; APin < 7; APin++) {

digitalWrite(APin, HIGH);

delay(timer);

digitalWrite(APin, LOW);

}

for (int APin = 6; APin >= 2; APin--) {

digitalWrite(APin, HIGH);

delay(timer);

digitalWrite(APin, LOW);

}

}

Arrays

int timer = 100;

int APins[] = {

2, 7, 4, 6, 5, 3

};

int pinCount = 6;

void setup() {

for (int APin = 0; APin < pinCount; APin++) {

pinMode(ledPins[APin], OUTPUT);

Serial.begin(9600);

}

}

void loop() {

for (int APin = 0; APin < pinCount; APin++) {

digitalWrite(ledPins[APin], HIGH);

delay(timer);

digitalWrite(ledPins[APin], LOW);

Serial.println(delay);

}

for (int APin = pinCount - 1; APin >= 0; APin--) {

digitalWrite(ledPins[APin], HIGH);

delay(timer);

digitalWrite(ledPins[APin], LOW);

Serial.println(delay);

}

}

Step 4: Step 4 :

now,

you have made it program then upload in arduino by usb cable and led will blink and you can enjoy

Here I am showing you some picture by led on loopiteration and arrays program which I have made it small practical.

Share

    Recommendations

    • Spotless Contest

      Spotless Contest
    • Microcontroller Contest

      Microcontroller Contest
    • Space Challenge

      Space Challenge
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    3 Comments

    Great...! this is a good practical as a beginner..... I like it

    Hah! And I thought this was a project in M.S. BASIC. ☺

    This is a great introduction to Arduino project. You should enter this in the First Time Authors contest.