Skip to content

Instantly share code, notes, and snippets.

@SaheblalBagwan
Created September 3, 2016 14:07
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/eb446d21ebdc716914458c6c7fc41a60 to your computer and use it in GitHub Desktop.
Save SaheblalBagwan/eb446d21ebdc716914458c6c7fc41a60 to your computer and use it in GitHub Desktop.
#include <reg51.h>
sbit LED = P2^0; // Bling the single LED connected to P2.0
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)
{
LED = 1; /* Turn ON the LED connected to P2.0 */
DELAY_ms(500);
LED = 0; /* Turn OFF the LED connected to P2.0 */
DELAY_ms(500);
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment