Skip to content

Instantly share code, notes, and snippets.

@SaheblalBagwan
Created September 3, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaheblalBagwan/94e270ed5a083a2b1ca575958f1ca953 to your computer and use it in GitHub Desktop.
Save SaheblalBagwan/94e270ed5a083a2b1ca575958f1ca953 to your computer and use it in GitHub Desktop.
#include <reg51.h>
void DELAY_ms(unsigned int ms_Count)
{
unsigned int i,j;
for(i=0;i<ms_Count;i++)
{
for(j=0;j<100;j++);
}
}
int main()
{
while(1)
{
P2 = 0xff; /* Turn ON all the leds connected to P2 */
DELAY_ms(500);
P2 = 0x00; /* Turn OFF all the leds connected to P2 */
DELAY_ms(500);
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment