?? pict11c.c
字號:
//<pre>
// pict11c.c
//
// Implementation of the PICT11.ASM program in Easy Pic 'N
// event counting demo
//
//
// Using '84 on a board (simple solderless breadboard with
// 16F84 on it) and Peter Anderson's include file with
// port/bit definitions (defs_f84.h available at www.phanderson.com)
// Settings:
// 4Mhz resonator (not important)
// All Port A inputs use external pullups (resistor SIP used)
// Port B outputs tied to a LED array (Radio Shack has 'em)
// Port A inputs tied to ground through four switches
// (pullups still are on them - makes it all work!)
// You turn A0 on and off and the count appears on the LED bar
#case
#include <16f84.h>
#include <defs_f84.h> // defines registers and bits
#fuses xt,nowdt,put,noprotect
void main(void)
{
int count=0;
TRISA=0x1f; // make porta all inputs
TRISB=0x00; // make portb all outputs
PORTB=0;
while(1)
{
while(ra0==0);
while(ra0==1);
count++;
PORTB=count;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -