Skip to content

Instantly share code, notes, and snippets.

@SaheblalBagwan
Last active February 4, 2016 09:28
Show Gist options
  • Save SaheblalBagwan/310b1582e0bec2ad28ad to your computer and use it in GitHub Desktop.
Save SaheblalBagwan/310b1582e0bec2ad28ad to your computer and use it in GitHub Desktop.
#include <avr/io.h>
int main()
{
DDRC = 0xff; // Configure PORTC as output to connect Leds
DDRA = 0x00; // Configure PORTA as INput to connect switches
PORTA = 0xff; // Enable The PullUps of PORTA.
while(1)
{
PORTC = PINA; // Read the switch status and display it on Leds
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment