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

📄 t1

📁 it program show how to drive the LCD to print make an output on the LCD by using PIC18f4520.
💻
字号:
#include <p18f4520.h>
#include <delays.h>
#include <timers.h>

#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
#pragma config BOREN = OFF

#pragma code high_vector=0x08

void interrupt_at_high_vector(void)
{
   _asm goto high_isr _endasm
}

#pragma code

#pragma interrupt high_isr
void high_isr(void)
{
	if (PIR1bits.TMR1IF)
	{
		PIR1bits.TMR1IF=0;
		TMR1L=0x9B;	//250us
		TMR1H=0xFF;
		motor_isr();
	}
}

//*************program code  *************//


void motor_isr(void)
{ 
	if (PORTDbits.RD3==1)
		PORTDbits.RD3=0;
	else
		PORTDbits.RD3=1;
/*	if (motor_count < motor_period)
		motor_count++;
	else
		motor_count = 0;
		
	if (motor_count < motor_speed)
	{
		if (motor_mode == FORWARD)
			motor_forward();
		if (motor_mode == BACKWARD)
			motor_backward();
	}
	else 
		motor_stop();*/
}

//*************** main program ***************//
void main(void)
{
}

⌨️ 快捷键说明

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