Home > other >  Keli4 compiler always appear LCD1602. H. (163) : error C202: & # x27; P1_5 & # x27; : undefined iden
Keli4 compiler always appear LCD1602. H. (163) : error C202: & # x27; P1_5 & # x27; : undefined iden

Time:09-16

The Build target 'target 1
The compiling single chip DS1302 electronic ringing the bell system LCD1602 display. C...
LCD1602. H (163) : error C202: 'P1_5: undefined identifier
LCD1602. H (171) : error C202: 'P1_5: undefined identifier
LCD1602. H (183) : error C202: 'P1_5: undefined identifier
LCD1602. H (191) : error C202: 'P1_5: undefined identifier
LCD1602. H (198) : error C202: 'P1_5: undefined identifier
LCD1602. H (212) : error C202: 'P1_7: undefined identifier
LCD1602. H (217) : error C202: 'P1_7: undefined identifier
LCD1602. H (225) : error C202: 'P1_7: undefined identifier
Single chip DS1302 electronic bell system LCD1602 display. C (1312) : warning C316: unterminated conditionals
Target not created

source code for

# # ifndef _LCD1602_H_
# define _LCD1602_H_

# define uchar unsigned char
# define uint unsigned int

# define data_1602 P0
Uchar code table_num []="0123456789 abcdefg";

Sbit rs=P2 ^ 5;//register select signal H: data register: L instruction register
Sbit rw=P2 ^ 6;//register select signal H: data register: L instruction register
Sbit e=P2 ^ 7;//plate falling edge selected signal trigger

/* * * * * * * * * * * * * * * * * * * * * * * delay function * * * * * * * * * * * * * * * * * * * * * * * */
Void delay_uint (uint q)
{
- while (q);
}

/* * * * * * * * * * * * * * * * * * * * * * * lcd1602 write command function * * * * * * * * * * * * * * * * * * * * * * * */
Void write_com (uchar com)
{
e=0;
Rs=0;
Rw=0;
P0=com;
Delay_uint (3);
E=1;
Delay_uint (25);
e=0;
}

/* * * * * * * * * * * * * * * * * * * * * * * lcd1602 write data function * * * * * * * * * * * * * * * * * * * * * * * */
Void write_data (uchar dat)
{
e=0;
Rs=1;
Rw=0;
P0=dat;
Delay_uint (3);
E=1;
Delay_uint (25);
e=0;
}

/* * * * * * * * * * * * * * * * * * * * * * * lcd1602 initialization Settings * * * * * * * * * * * * * * * * * * * * * * * */
Void init_1602 ()//lcd1602 initialization setting
{
Write_com (0 x38);//
Write_com (0 x0c);
Write_com (0 x06);
}

/* * * * * * * * * * * * * * * * * * * * * * * on the lcd1602 display two decimal number * * * * * * * * * * * * * * * * * * * * * * * */
Void write_sfm1 (uchar hang, uchar add, uchar date)
{
If (hang==1)
Write_com (0 x80 + add);
The else
Write_com (0 x80 + 0 x40 + add);
Write_data (0 x30 + date % 10);
}

/* * * * * * * * * * * * * * * * * * * * * * * on the lcd1602 display two decimal number * * * * * * * * * * * * * * * * * * * * * * * */
Void write_sfm2_ds1302 (uchar hang, uchar add, uchar date)
{
Uchar shi ge;
If (hang==1)
Write_com (0 x80 + add);
The else
Write_com (0 x80 + 0 x40 + add);
Shi=date/16;
Ge=16 date %;

Write_data (table_num (shi));
Write_data (table_num (ge));
}

/* * * * * * * * * * * * * * * * * * * * * * * on the lcd1602 display the character function * * * * * * * * * * * * * * * * * * * * * * * */
Void write_string (uchar hang, uchar add, uchar * p)
{
If (hang==1)
Write_com (0 x80 + add);
The else
Write_com (0 x80 + 0 x40 + add);
While (1)
{
If (* p=='\ 0') break;
Write_data (* p).
p++;
}
}

/* * * * * * * * * * * * * * * * * control the cursor function * * * * * * * * * * * * * * * * * * * */
Void write_guanbiao (uchar hang, uchar add, uchar date)
{
If (hang==1)
Write_com (0 x80 + add);
The else
Write_com (0 x80 + 0 x40 + add);
If (date==1)
Write_com (0 x0f);//flashing cursor and
The else
Write_com (0 x0c);//close the cursor
}


/* * * * * * * * * * * * * * * * boot function to initialize the contents of the LCD liquid crystal display (LCD) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Void init_1602_dis_csf initialization ()//LCD
{
Write_string (1, 0, ": : W:");
Write_string (2, 0, 20 - "-");

}














# # ifndef _LED_H_
# define _LED_H_
Unsigned char flag_beep_en;

//define the car driver module input IO mouth

Sbit IN3=P1 ^ 5;
Sbit IN4=P1 ^ 6;

Sbit EN2=P1 ^ 7;



# define Right_moto_pwm P1_7//PWM signal end


# define Right_moto_go {P1_5=1, P1_6=0; }//on the right side of the motor forward
# define Right_moto_back {P1_5=0, P1_6=1; }//right motor walk backwards
# define Right_moto_Stop {P1_5=0, P1_6=0; }//right motor stalling


Unsigned char pwm_val_right=0;
Unsigned char push_val_right=0; Duty ratio N/right/motor/20
Bit Right_moto_stop=1;

Unsigned int time3=0;


//s-tronic forward
Void the run (void)
{

Push_val_right=35;

Right_moto_go;//right motor forward
Flag_beep_en=0;
}
Void run_1 (void)
{

Push_val_right=3;

Right_moto_go;//right motor forward
Flag_beep_en=0;
}



//s-tronic back
Void back (void)//back
{

Push_val_right=35;

Right_moto_back;//right motor forward
Flag_beep_en=0;
}
Void back_1 (void)//back
{

Push_val_right=3;

Right_moto_back;//right motor forward
Flag_beep_en=0;
}

//stop
Void stop (void)
{
Right_moto_Stop;
Flag_beep_en=0;

}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */motor speed right
Void pwm_out_right_moto (void)
{
If (Right_moto_stop)
{
If (pwm_val_right & lt;=push_val_right)
{
Right_moto_pwm=1;

}
The else
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related