Tuesday, August 16, 2016

Blink

This program is about

  • Turns on an LED on for one second, then off for one second, repeatedly.
Important - Most Arduinos have an on-board LED you can control. On the Uno and

                  Leonardo, it is attached to digital pin 13. If you're unsure what
                  pin the on-board LED is connected to on your Arduino model, check
                  the documentation.
According to the above selection set a LED(+ pin) to 13th pin of the arduino board. Then it's (-) pin should connect arduino board ground port.

void setup() {  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

void loop() {// the loop function runs over and over again forever
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Write this code in compiler. Then verify -> Upload.

  • the setup function runs once when you press reset or power the board.
After upload code to the arduino. You will see the blinking LED. 





Sunday, August 7, 2016

Analog Read Serial

Analog Read Serial

       Before you start to write programs you should download the relevant compiler.  To download the compiler before you should check the version according to your computer/ Your operating system. Assume your computer has Windows Operating System, You should download the Windows Installer.  
       After install the compiler successfully connect Arduino device to the computer.
Then open the compiler, If it successfully connected you will see the device name under the left-hand side down corner. go to Tools -> Port. Then you will see the port number connected to the device. 

       This program is about 
  • Reads an analog input on pin 0, prints the result to the serial monitor.
  • Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
  •  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

void setup() { // initialize serial communication at 9600 bits per second: 
  Serial.begin(9600);
}

void loop() {// the loop routine runs over and over again forever:
  int sensorValue = analogRead(A0);  // read the input on analog pin 0: 
  Serial.println(sensorValue); // print out the value you read:
  delay(1);        // delay in between reads for stability
}

To demonstrate that program we connect LM35 temperature sensor to thr A0 port.
Then go to Tools -> serial Plotter, you will see the temperature value on it.

Tuesday, June 21, 2016

What is Arduino

        In my first postI'm going to explain what is arduino. Arduino is a small circuit. As shown  in the above image, the circuit board has 28pin IC(integrated circuit). This circuit board has 28 pin IC and  small basic electronic components.  Actually this IC is not a microcontroller . This is a small microcontroller called Atmel AVR.  This microcontroller is similar to a small computer. This microcontroller can store 0.5KB - 512 KB data at one time. This AVR has many types. Those are tinyAVR, megaAVR and XMEGA. 
 
Basic families of Arduinos shown below. 

Basic families

AVRs are generally classified into six broad groups:
  • tinyAVR — the ATtiny series
    • 0.5–16 kB program memory
    • 6–32-pin package
    • Limited peripheral set
    • Current lineup
  • megaAVR — the ATmega series
    • 4–512 kB program memory
    • 28–100-pin package
    • Extended instruction set (Multiply instructions and instructions for handling larger program memories)
    • Extensive peripheral set
  • XMEGA — the ATxmega series
    • 16–384 kB program memory
    • 44–64–100-pin package (A4, A3, A1)
    • Extended performance features, such as DMA, "Event System", and cryptography support.
    • Extensive peripheral set with DACs
  • Application-specific AVR
    • megaAVRs with special features not found on the other members of the AVR family, such as LCD controller, USBcontroller, advanced PWM, CAN, etc.
  • FPSLIC (AVR with FPGA)
    • FPGA 5K to 40K gates
    • SRAM for the AVR program code, unlike all other AVRs
    • AVR core can run at up to 50 MHz
  • 32-bit AVRs
       According to these families, it can change memory capacity, Speed and the price. 

In the picture shown below shows the parts of the development board to connect to the power and the parts we want for programming. 

       When we take the wholecircuit we can put it under open source category. That means anyone can change the design in expected manner. So that we can call Arduino  to open source hardware. We use C++ programming language to program the Arduino.  

       If you have this gadget you can do anything in the technical world. Only thing you want is the experience and the ability. Creating a robot may be a dream of someone. Arduino is the best solution for that dream. Arduino is designed not for the professional pic programmers, but for the normal people. So that do not think much about the programming part. Other thing is you can get predefined code freely, from arduino  web site.