Guest User

Code_Cau1

a guest
Jan 15th, 2020
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define _XTAL_FREQ 4000000
  2.  
  3. void main ( void )
  4.  
  5. {
  6. ANSEL = 0;
  7. ANSELH = 0;
  8. TRISD = 0x00;
  9.  
  10.  
  11. while(1)
  12. {
  13. //TAT_HET//
  14. PORTD = 0b00000000;
  15. __delay_ms(400);
  16. //SANG_HET//
  17. PORTD = 0b11111111;
  18. __delay_ms(400);
  19. //TAT_HET//
  20. PORTD = 0b00000000;
  21. __delay_ms(500);
  22. //D1-D4_SANG_DAN->D5-D8_TAT//
  23. PORTD = 0b00000001;
  24. __delay_ms(400);
  25. PORTD = 0b00000011;
  26. __delay_ms(400);
  27. PORTD = 0b00000111;
  28. __delay_ms(400);
  29. PORTD = 0b00001111;
  30. __delay_ms(400);
  31. //D1-D4_TAT->D5-D8_SANG_DUOI//
  32. PORTD = 0b10000000;
  33. __delay_ms(400);
  34. PORTD = 0b11000000;
  35. __delay_ms(400);
  36. PORTD = 0b11100000;
  37. __delay_ms(400);
  38. PORTD = 0b11110000;
  39. __delay_ms(400);
  40. }
  41. }
RAW Paste Data