/**************************************************/
/**************************************************/
/**************************************************/
/**************************************************/
#include <ny8.h>
// NY8BE62D_S16
// _______ _______
// |1 vdd \_/ vss 16|
// |2 pa6 pa4 15|-scl
// |3 pa7 pa3 14|
// |4 pa5 pa2 13|-sda
// |5 pb3 pa1 12|
// led_4-|6 pb2 pa0 11|-led_1
// led_5-|7 pb1 pb5 10|-led_2
// led_6-|8_pb0______pb4__9|-led_3
// LCD CS3631AW-4-D
// @1@2@3@4@5@6
// ___A1___ ___A2___ ___A3___
// F1 B1 F2 B2 F3 B3
// |___G1___| |___G2___| |___G3___|
// E1 C1 DP E2 C2 DP E3 C3 DP
// |___D1___|. |___D2___|. |___D3___|.
// 1 1 4 5 1 2 3 1 2 2 5 2 2 3 4 3 5 3 4 6 6 4 5 4
// | | | | | | | | | | | | | | | | | | | | | | | |
/* /|\/|\/|\/|\/|\/|\/|\/|\ /|\/|\/|\/|\/|\/|\/|\/|\ /|\/|\/|\/|\/|\/|\/|\/|\*/
// | | | | | | | | | | | | | | | | | | | | | | | |
// 2 3 1 1 4 1 1 6 3 4 2 6 5 2 2 6 4 5 5 1 3 3 3 6
// A1 B1 C1 D1 E1 F1 G1 DP A2 B2 C2 D2 E2 F2 G2 DP A3 B3 C3 D3 E3 F3 G3 DP
/**************************************************/
__sbit led_1 =PORTA:0;
__sbit led_2 =PORTB:5;
__sbit led_3 =PORTB:4;
__sbit led_4 =PORTB:2;
__sbit led_5 =PORTB:1;
__sbit led_6 =PORTB:0;
/**************************************************/ //0输出1输入
#define led_1_h IOSTA&=~(1<<0);led_1=1
#define led_2_h IOSTB&=~(1<<5);led_2=1
#define led_3_h IOSTB&=~(1<<4);led_3=1
#define led_4_h IOSTB&=~(1<<2);led_4=1
#define led_5_h IOSTB&=~(1<<1);led_5=1
#define led_6_h IOSTB&=~(1<<0);led_6=1
#define led_1_l IOSTA&=~(1<<0);led_1=0
#define led_2_l IOSTB&=~(1<<5);led_2=0
#define led_3_l IOSTB&=~(1<<4);led_3=0
#define led_4_l IOSTB&=~(1<<2);led_4=0
#define led_5_l IOSTB&=~(1<<1);led_5=0
#define led_6_l IOSTB&=~(1<<0);led_6=0
#define led_1_g IOSTA|=1<<0
#define led_2_g IOSTB|=1<<5
#define led_3_g IOSTB|=1<<4
#define led_4_g IOSTB|=1<<2
#define led_5_g IOSTB|=1<<1
#define led_6_g IOSTB|=1<<0
/**************************************************/
void yanshi(unsigned int x);
/**************************************************/
void main(void)
{
led_1_g;
led_2_g;
led_3_g;
led_4_g;
led_5_g;
led_6_g;
while(1)
{
led_1_l;
led_2_h;
yanshi(200);
led_1_g;
led_2_g;
yanshi(200);
}
}
/**************************************************/
void yanshi(unsigned int x)
{
unsigned int y,z;
{
for(y=x;y>0;y--)
{
for(z=1000;z>0;z--){}
}
}
}
/**************************************************/
/**************************************************/
/**************************************************/
/**************************************************/
|