Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int main(void)
  2. {
  3.  
  4. DDRC = 0xFF; //output led
  5. PORTD = 0x04; //PD2 high for switch interrupt
  6. serial_Init();
  7. GICR = (1<<INT0);
  8. sei();
  9. while(1)
  10. {
  11.  
  12. }
  13. }
  14. ISR (INT0_vect)
  15. {
  16.  
  17. serial_Tx("ATD<number>;rn");
  18. }
  19.  
  20. ISR(USART_RXC_vect)
  21. {
  22.  
  23.  
  24. }
  25.  
  26. void serial_Tx(char *str)
  27. {
  28. for (unsigned int i=0;str[i]!=0;i++)
  29. {
  30. UDR=str[i];
  31. while(!(UCSRA&(1<<UDRE)));
  32. }
  33. }
  34.  
  35. char serial_Rx()
  36. {
  37. while(!(UCSRA & (1<<RXC)));
  38. return UDR;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement