Add the following snippet to your HTML:
music light project gives two different color lights blink when play music without music system connection.
Read up about this project on
/* * music lights.c * * Created: 09-07-2015 16:19:04 * Author: SURIA SARATH */ #include <avr/io.h> #include <util/delay.h> int blink_blue(void) { DDRC = 0xff; PORTC = 0x20; return 0; } int blink_red(void) { DDRC = 0xff; PORTC = 0x10; return 0; } int main() { DDRA=0x00; while(1) { if (PINA & (1<<PA0)==1) { blink_red(); _delay_ms(200); } if (PINA | (1<<PA0)==1) { blink_blue(); _delay_ms(3); } } }
Comments