single button for led on/off
One micro button for turn on the LED and turn OFF the LED. it is very simple and the code.
- atmega 16 microcontroller
- micro button
- 3v LED
- 5v supply
softwares
- atmel studio
- extreme burner
PROGRAMME
/*
* switch_or.c
*
* Created: 10/3/2015 2:43:36 PM
* Author: suriasarath
*/
#include <avr/io.h>
#include <util/delay.h>
int val1;
int main(void)
{
DDRA=0xff;
while(1)
{
val1=PINB;
if (val1==0xfe)
{
PORTA ^= (1 << 0);
_delay_ms(1000);
}
}
}
Tt is very simple code...................