Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #include <util/delay.h>
- #include <avr/interrupt.h>
- #include "hd44780.h"
- #include <stdlib.h>
- #include <avr/pgmspace.h>
- #include <string.h>
- #include "myuart/myuart.h"
- #include "MK_TERMINAL/mk_term.h"
- int main()
- {
- DDRD = 0xFF; // led
- PORTD = 0x00;
- uart_init( __UBRR );
- sei(); /* globalne zezwolenie na przerwania */
- while(1)
- {
- }//koniec while(1)
- }//koniec main
- ISR( USART_RXC_vect ) // bt
- {
- char zmienna = UDR; // rejestr, w którym zapisujemy odebrany znak
- if (zmienna == 'a') // on
- {
- PORTD = 0x01;
- }
- if (zmienna =='b') // off
- {
- PORTD = 0x00;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement