getting started with arduino

by 11:37 4 comments

1. Download Arduino IDE

         You can download it from here
        
         Choose your operating system (normally windows) and download will start.

2. Install Arduino IDE

         The install process is normal, just press next and finish like any program you installed before.

3. Prepare your circuit

         Here we are starting so we will make very simple one, Just put LED like the image

4. Try basic example

         Copy and paste next code

int led = 13;

void setup() {               
  pinMode(led, OUTPUT);    
}

void loop() {
  digitalWrite(led, HIGH);  
  delay(1000);              
  digitalWrite(led, LOW);   
  delay(1000);              
}

         Then press verify button (the right sign in the top left), this will compile your code and show errors if any.

         What should this code do? first (int led = 13;) this is for detecting the pin where we want to put the positive term of the LED.

         Second (void setup()) function, this function runs only once, the pinMode function used to detect if i use the pin as output or input.

         The (void loop()) functions runs all the time (repeat itself), to stop it you should unplug the power.

         The first line in it (digitalWrite(led, HIGH)) outputs +5V on the led (13) pin, the third (digitalWrite(led, LOW)) outputs 0V on it.

         The delay(x) function tells the arduino to wait x milliseconds before continue your code.

         Now put your LED, positive term on pin 13 and negative pin on ground.

        Plug your Arduino board using usb, press tools > board > (your board), and tools > port > (port)

         Now press the load button (beside verify button) and see your LED blinking.

Ammar Atef

Blog Creator

Always work and you will be happy, Writing code, designing system and learning some thing new, I call that real life, No matter what is the problem, humanity can solve it any way, Creative one who believes he is creative, Who really watch, think, try and success, World is watching us because we are engineers.

4 comments:

  1. يا بشمخمدس عمر بالنسبة ل pin =13 دى ممكن توضيحها اكتر يعنى فى بورت رقمه 13 فى الشريحة هحط فيها اللمبة ولا ده رقم وخلاص موجب وعلى اى اساس اخرته لو كان رقم وخلاص حضرتك

    ReplyDelete
    Replies
    1. رقم 13 هو رقم pin ف البوردة
      وانت بتحط الطرف الموجب فيه والسالب توصله بالارضي
      وانا اخترت 13 عشان جنبه طرف ارضي فتقدر تحط الled بسهولة من غير تغيير اي اسلاك

      Delete
    2. جزاك الله خيرا :)

      Delete