You are on page 1of 3

Date : 19-06-2016

MICROCONTROLLER

Single chip computer.

It has memory + ram + rom

Code:

#include<avr/io.h>

#include<util/delay.h>

Int main()

///DDR = Data direction register.

DDRA = 0b11111111; ///pins of port A will be set as OUTPUT

portA=0b11111111; /// All pins of port A will get 5v

/// IF there were 8 zeros then the port A would have been set as input

Pa0,pa1,pa2,..,pa7

At 1st output programming will be done.


Code:

#include<avr/io.h>

#include<util/delay.h>

Int main()

DDRA = 0b11111111;

While(1)

PortA= 0b11111111;

-delay-ms(1000);

PortA= 0b00000000;

-delay-ms(1000);

}
Code:

#include<avr/io.h>

#include<util/delay.h>

Int main()

DDRA = 0b11111111;

while(1)

PortA= 0b10101010;

_delay_ms(1000);

PortA= 0b01010101;

_delay_ms(1000);

______________________________________________________________________________

You might also like