Skip to content

Instantly share code, notes, and snippets.

#include <htc.h>
#define _XTAL_FREQ 20000000
void delay(unsigned int time) //Time delay function
{
unsigned int i,j;
for(i=0;i< time;i++)
for(j=0;j<5;j++);
}
#include<reg52.h>
sbit rs=P3^5;
sbit rw=P3^6;
sbit en=P3^7;
void delay()
{
unsigned int i,j;
for(i=0;i<700;i++)
#include<reg51.h>
sbit rs=P3^0; //GLCD control pins
sbit rw=P3^1;
sbit en=P3^2;
sbit cs1=P3^3;
sbit cs2=P3^4;
sbit re=P3^5;
void delay(unsigned int d){ //random delay generation
#include<reg52.h>
void display();
sbit rs=P3^5; //Register select (RS)
sbit en=P3^6; //Enable (EN) pin
void delay(unsigned int time) //Time delay function
{
unsigned int i,j;
#include<reg51.h>
sbit led=P1^0;
void delay()
{
int count=0,sec;
for(sec=0;sec<60;sec++){
count=0;
while(count!=500)
{
#include<reg51.h>
sbit led=P1^0; //Led connected to port-1 pin#0
void delay()
{
int count=0;
while(count!=500)
{
@d-boz-wtwh
d-boz-wtwh / button-and-led-with-8051.c
Created October 22, 2019 21:03
Microcontroller Projects
#include<reg52.h>
sbit button=P1^0; //Push button pin declared
sbit led=P1^1; //Led pin declared
void main()
{
P1=0x01; //Push button as input and led as output
@d-boz-wtwh
d-boz-wtwh / counter-with-8051.c
Created October 22, 2019 21:03
Microcontroller Projects
#include<reg52.h>
void delay()
{
unsigned int i,j;
for(i=0;i< 500;i++)
for(j=0;j< 1000;j++);
}
void main()
{
@d-boz-wtwh
d-boz-wtwh / counter-with-8051.c
Created October 22, 2019 21:03
Microcontroller Projects
#include<reg52.h>
void delay()
{
unsigned int i,j;
for(i=0;i< 500;i++)
for(j=0;j< 1000;j++);
}
void main()
{
@d-boz-wtwh
d-boz-wtwh / counter-with-8051.c
Created October 22, 2019 21:03
Microcontroller Projects
#include<reg52.h>
void delay()
{
unsigned int i,j;
for(i=0;i< 500;i++)
for(j=0;j< 1000;j++);
}
void main()