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

📄 f_8_19b_ledtoggle_b.c

📁 PIC_Hi-Tech_C_Mike_Pearces_I2C_routines Microchi PIC_Hi-Tech C_I2C_for_EEPROM_24LC01B Code
💻 C
字号:
#include "config.h"#include "delay.h"// this code illustrates one RIGHT way to toggle// an LED on or off on each press and release// of a switch.// Switch debouncing delay is included. void main(void){  TRISB = 0xEF;		// set RB4 as output    RB4 = 0;		// turn RB4 off  while(1) {     // wait for press    while (RB6);     DelayMs(30);  //debounce    // wait for release    while (!RB6);     DelayMs(30);  //debounce    RB4 = 1;      //turn on    // wait for press    while (RB6);     DelayMs(30);  //debounce    // wait for release    while (!RB6);     DelayMs(30);  //debounce    RB4 = 0;      //turn off  }}

⌨️ 快捷键说明

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