main.c

来自「Hitech PICC 绿色版(V8.05PL2)」· C语言 代码 · 共 20 行

C
20
字号
#include <stdio.h>
#include <pic.h>

/* A simple demonstration of serial communications which
 * uses the bit-banging implementation of a serial communications.
 * Useful for PIC16Cxxx series of devices, or if USART is already
 * in use. */

void main(void){
	unsigned char input;

	INTCON=0;	// purpose of disabling the interrupts.

	printf("\rPress a key and I will echo it back:\n");
	while(1){
		input = getch();	// read a response from the user
		printf("\rI detected [%c]",input);	// echo it back
	}
}

⌨️ 快捷键说明

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