Search

Thursday, December 18, 2014

LED INCREAMENT PATTERN

*///////////////////////////////////////////////////////////////////
//Author : Palak Patel
//Contact No : 9173211683
//Title : Led Pattern
//Platform : 8051
//Software : Keil 4.0
//Created: 15-05-2014
////////////////////////////////////////////////////////////////////*

In this program as you press the switch it will increament the led..

Program:

#include<reg51.h>
#define led P1
sbit sw=P2^0;

void delay();

void main()
{
unsigned char k;
led=0x00;
k=0x00;
while(1)
{
if(sw==0)
{
k=(2*k)+1;
led=k;
delay();

if(k==255)
k=0;
}
}
}

void delay()
{
unsigned int i;
for(i=0;i<40000;i++);
}

Simulation:




...................................................................................................................................................................


PIC 18 F4520 Microcontroller

1).PIC18f4520 Features - Here

2).LED Interface With PIC18f4520 -Here

3).PWM using PIC18F4520 - Here

4).ADC 20 V Using PIC18F4520 - Here

5).ADC using PIC18F4520 - Here

6).DAC Using PIC18F4520 - Here

7).USART Transmission With PIC18F4520 - Here

8).USART Receiver With PIC18F4520 - Here

9).RTC Interface Using I2C With PIC18F4520 -Here

10).DC Motor Interface With PIC18f4520 - Here

11).7 SEGMENT Interface With PIC18f4520 - Here

12).LCD 4_Bit Interface With PIC18F4520 -Here

13).LCD 8_Bit Interface with PIC18F4520 -Here


8051 Microcontroller

1).Led Pattern(5 Patterns using Switch) - Here

2).Led Increament PatternHere


...................................................................................................................................................................

No comments:

Post a Comment