Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<mega16.

h>
#include<delay.h>
int geser=1;
void main(void)
{
PORTB=0x00;
DDRB=0xff;
delay_ms(200);
PORTB=0x01;
delay_ms(200);
while (1)
{
if (geser<0)
{
geser=0x01;
}
delay_ms(200);
PORTB=geser;
geser<<=1;
};
/* char urutan [3]={0x02,0x01,0x04};
char i;
PORTB=0xff;
DDRB=0xff;
while (1)
{
for (i=0;i<3;i++)
{
PORTB=urutan[i];
delay_ms(1000);
}; */
}

You might also like