Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- const int rs = 8, en = 9, d4 = 2, d5 = 3, d6 = 4, d7 = 5;
- LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
- void setup()
- {
- DDRD|=0x40;//setare Timer0 mod Fast PWM
- TCCR0A=0x83;
- TCCR0B=0x02;//setare comunicatie cu aceiasi parametri ca si emitatorul
- UBRR0=0x67;//9600 baud UBRR=103
- UCSR0B=(1<<RXEN0);//validare receptie
- UCSR0C=(1<<USBS0)|(1<<UCSZ00)|(1<<UCSZ01);//2 biti stop,8 bit data
- lcd.begin(16, 2);
- }
- void loop()
- {
- lcd.setCursor(0, 0);
- while(!(UCSR0A&(1<<RXC0)))delay(10);//asteapta un numar receptionat in UDR0
- lcd.write(UDR0);
- delay(10);
- }
Advertisement
Add Comment
Please, Sign In to add comment