12864h.txt in 12864h2.rar
Sponsored links
/*使用MCU: ATMEGA8535L
LCD MODULE: 128*64
IC Control:S6B0108
*/
#include <avr/io.h>
#include <inttypes.h>
//#include <stdlib.h>
#include <avr/delay.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#define pdout PORTC
#define pdin PINC
#define pcont PORTB
#define pcont1 PORTD
#define e PB0
#define rw PB1
#define rs PB2
#define cs1 PB3
#define cs2 PB4
#define rst PD6
#define set_Bit(val, bitn) (val |=(1<<(bitn))) //设置某一位
#define clr_Bit(val, bitn) (val&=~(1<<(bitn))) //清除某一位
#define get_Bit(val, bitn) (val &(1<<(bitn)) ) //取某一位
#define nop() asm("nop")
#define TC2_EN TIMSK |= (<<1OCIE2)|(1<<TOIE2) //启动TC2定时比较和溢出
#define TC2_DIS TIMSK &=~ (1<<OCIE2)|(1<<TOIE2)//禁止TC2再定时比较和溢出
#define uchar unsigned char //
#define uint unsigned int //
static uint g_aAdValue[8]; //A/D 转换缓冲
//static uchar g_datbuf[5];// 串口通讯数据缓冲区 接收存储空间
static uchar datbuf1=0;
static uchar datbuf2=0;
static uchar datbuf3=0;
static uchar datbuf4=0;
// uchar datbuf[5]={0,0,0,0,0,};
// static uchar g_aAdValue[5];
static uchar column;
static uchar row;
///static uint example;
//static uchar columnbuf;
//static uchar rowbuf;
static uchar cursor=0x5f;
static uchar autoscroll=0; //自动卷动标志
static uchar pwmbuf;
//=====================================================
const prog_uchar leddat[]= //
{
"0" /*0*/
"1"/*1*/
"2"/*2*/
"3"/*3*/
"4"/*4*/
"5"/*5*/
"6"/*6*/
"7"/*7*/
"8"/*8*/
"9"/*9*/
"A"/*A*/
"B"/*B*/
"C"/*C*/
"D"/*D*/
"E"/*E*/
"F"/*F*/
};
/////////////////8*8 dots/////////////////////////////////
const prog_uchar t5x8[]={
0x00,0x00,0x00,0x00,0x00, //" "=00H
0x00,0x00,0x4F,0x00,0x00, //"!"=01H
0x00,0x07,0x00,0x07,0x
...
...
... to be continued.
This is a preview. To get the complete source file,
please click here to download the whole source code package.