Skip to content

Instantly share code, notes, and snippets.

@raghavendrahassy
Last active March 29, 2016 05:13
Show Gist options
  • Save raghavendrahassy/64c40290330c2e4edb6f to your computer and use it in GitHub Desktop.
Save raghavendrahassy/64c40290330c2e4edb6f to your computer and use it in GitHub Desktop.
#include <avr/io.h>
#include <util/delay.h>
#define Relay PA0
int main()
{
/* Configure the port A0 as Output */
DDRA = (1 << Relay);
while(1)
{
PORTA = (1 << Relay);; /* Turn ON the Relay */
_delay_ms(5000);
PORTA = (0 << Relay);; /* Turn OFF the Relay */
_delay_ms(5000);
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment