Arjun Gopkumar
Published

Blink That LED

A simple blink code for 89C51 microcontroller.

BeginnerProtip6 minutes498
Blink That LED

Things used in this project

Hardware components

89c51
×1
8051 development board
×1
LED (generic)
LED (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×1

Software apps and online services

keil micro-vision 3

Story

Read more

Schematics

img_20190330_091202_lAHEvpivX6.jpg

Code

Untitled file

C/C++
Should work with any dev board, its really simple
#include<reg51.h>

sbit led=P0^0;

void delay(unsigned int a)
{			 

int i, j;
	for(j=0;j<a;j++)
		for(i=0;i<100;i++);
		
}

void main()
{

//The 8051 dosent have what it takes to drive the LED
//hence the circuit
led=0;//off
delay(1000);
led=1;//on
delay(1000);

	
}

Credits

Arjun Gopkumar

Arjun Gopkumar

5 projects • 1 follower
Engineering student , I create just because I can and to possibly make the world a better place . I hack for the love of it.

Comments