⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_8_5_ledflash.c

📁 PIC_Hi-Tech_C_Mike_Pearces_I2C_routines Microchi PIC_Hi-Tech C_I2C_for_EEPROM_24LC01B Code
💻 C
字号:
#include "config.h"

// a subroutine that implements a delay via loops 
// Note that the compile option used will alter this delay! 
// Always use -O compile option 

void a_delay(void){
  unsigned int i,k;
  // change count values to alter delay 
  for (k=1800; --k;) {
    for(i = 200 ; --i ;);
  }
}

// just flash LED on port RB1  
// use this to test if PIC board is alive  
void main(void)
{

  TRISB1 = 0;		// set RB1 as output  
  RB1 = 0;		// turn RB1 off

  while(1) {  // note infinite loop, all PIC programs should
             //	be an infinite loop of some kind. Why? If the
             // loop exited, what would the PIC do?  

    a_delay();  // a subroutine that implements a delay via loops  
    RB1 = 1;	// turn on RB1  
    a_delay();
    RB1 = 0;	// turn off RB1  
  }
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -