Advertisement
RuiViana

Teste_Blink

Dec 29th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <18F4550.h>
  2. #device ADC=16
  3.  
  4. #FUSES NOWDT                    //No Watch Dog Timer
  5. #FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
  6. #FUSES NOBROWNOUT               //No brownout reset
  7. #FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
  8. #FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
  9.  
  10. #use delay(clock=48000000,crystal=4000000)
  11.  
  12.  
  13. void main()
  14. {
  15.    set_tris_d(0b00000000);      // RD  on LEDs.  
  16.    
  17.    while(true)                 // infinito.
  18.    {
  19.      output_d(0XFF);            // Acende todos LEDs portD
  20.      delay_ms(1000);             // delay 2 secs
  21.      output_d(0);               // Apaga todos LEDs portD  
  22.      delay_ms(1000);             // delay 2 secs
  23.    }      
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement