You are on page 1of 6

Arduino Programming

Dr. Fakhre Alam Khan


MED UET Peshawar
ARDUINO MEGA 2560 Board
 Arduino board is an open-source microcontroller board which is based on Atmega 2560
microcontroller.
 It includes digital input/output pins-54, where 16 pins are analog inputs, 14 are used like
PWM outputs hardware serial ports (UARTs) – 4, a crystal oscillator-16 MHz, an ICSP
header, a power jack, a USB connection, as well as an RST button.
ARDUINO MEGA 2560 Board
Arduino Mega Specifications:
 The ATmega2560 is a Microcontroller.
 The operating voltage of this microcontroller is 5volts
 The recommended Input Voltage will range from 7volts to 12volts
 The input voltage will range from 6volts to 20volts
 The digital input/output pins are 54 where 15 of these pins will supply PWM o/p.
 Analog Input Pins are 16
 DC Current for each input/output pin is 40 mA
 DC Current used for 3.3V Pin is 50 mA
 Flash Memory like 256 KB where 8 KB of flash memory is used with the help of bootloader.
 The static random access memory (SRAM) is 8 KB
 The electrically erasable programmable read-only memory (EEPROM) is 4 KB
 The clock (CLK) speed is 16 MHz
 The USB host chip used in this is MAX3421E
 The length of this board is 101.52 mm
 The width of this board is 53.3 mm
 The weight of this board is 36 g
LED blinking control through programming using Arduino mega-2560 board.

// the setup function runs once when you press reset or power the board
int led = 13;
void setup() {
// initialize digital pin 13 as an LED output.
pinMode(led, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH); // turn the LED on by making the voltage HIGH
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Alternate LEDs blinking control through programming using Arduino mega-2560 board.

// the setup function runs once when you press reset or power the board
int LED1 =13, LED2=11;
void setup() {
// initialize digital pins 13 and 11 as LED1 and LED2 outputs.
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(LED1, HIGH); // turns the LED1 on by making the voltage HIGH
digitalWrite(LED2, LOW); // turn the LED2 off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(LED1, LOW); // turn the LED1 off by making the voltage LOW
digitalWrite(LED2, HIGH); // turn the LED2 on by making the voltage HIGH
delay(1000); // wait for a second
}
Final Project (Group -3 students)
• Well written report, should be complete in all aspects. (Well explained)
• Student particulars
• Project theoretical background
• Project objectives
• Logic used
• Components used
• Code
• Project outcome / Output result
• Practical working/operational model of circuit controlled through
programming code.
• Due date (On viva day)

You might also like