Home > other >  Leds. C (207) : error C141: syntax error near & # x27; } & # x27; Pray god help see this where there
Leds. C (207) : error C141: syntax error near & # x27; } & # x27; Pray god help see this where there

Time:09-16

#include
#include

# define DA0832 XBYTE [0 xfffe]

# define uchar unsigned char
# define uint unsigned int

P1 sbit S1=^ 0;
P1 sbit S2=^ 1;
//00 sawtooth wave; 01 square wave; 10 the triangle wave; 11 sine wave

Sbit RS=p ^ 2;//data/command select end (H/L)
Sbit RW=P1 ^ 3;//read/write choice end (H/L), only to write this article, so the port used for low level
Sbit EN=P1 ^ 4;//can make side
Sbit wela=P3 ^ 3;//latch a select signal
Uchar table1 []="sawtooth wave";//character table 1
Uchar table2 []="square wave";//character table 2
Uchar table3 []="triangular wave";//character table 3
Uchar table4 []="going wave";//character table 4
Uchar table5 []="f=1000 hz, A=200";//character table 5
Uchar code sin_tab []=//sine wave output table
{
X86 0 x80, 0 x83, 0, 0, x89 x8d 0, 0 x90, 0 x93, 0 x96, 0 x99, 0 x9c, 0 x9f, 0 xa2, 0 xa5, 0 xa8, 0 xab, 0 xae,
Xb7 xb1 0, 0 xb4, 0, 0, xba XBC 0, 0 XBF, 0 xc2, 0 xc5, 0 xc7, 0 xca, 0 XCC, XCF 0, 0 xd1, 0 xd4, 0 xd6, 0 xd8,
0 xda, 0 XDD, 0 XDF, 0 xe1, 0 xe3, 0 xe5, 0 xe7, 0 xe9, 0 xea, xec 0, 0 xee, 0 xef, 0 xf1, 0 xf2, 0 xf4, 0 xf5,
Xf7 0 xf6, 0, 0 xf8, 0 xf9, 0 xfa, 0 XFB, 0 XFC, 0 XFD, 0 XFD, 0 xfe, 0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF.
0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 xfe, 0 XFD, 0 XFD, 0 XFC, 0 XFB, 0 xfa, 0 xf9, 0 xf8, 0 xf7, 0 xf6,
Xf2 xf5 0, 0 xf4, 0, 0, xf1 xef 0, 0 xee, xec 0, 0 xea, 0 xe9, 0 xe7, 0 xe5, 0 xe3, 0 xe1, 0 XDF, 0 XDD, 0 xda,
Xd4 xd8 0, 0 xd6, 0, 0 xd1, XCF 0, 0 XCC, 0 xca, 0 xc7, 0 xc5, 0 xc2, 0 XBF, 0 XBC, xba 0, 0 xb7, 0 xb4, 0 xb1,
Xa8 xae 0, 0 xab, 0, 0, xa5 xa2 0, 0 x9f, 0 x9c, 0 x99, 0 x96, 0 x93, 0 x90, 0 x8d, 0 x89, 0 x86, 0 x83, 0 x80,
X7c 0 x80, 0, 0 x79, 0 x76, 0 x72, 0 x6f, 0 x6c, 0 x69, 0 x66, 0 x63, 0 x60, 0 x5d, 0 x5a, 0 x57, 0 x55, 0 x51,
X48 x4e 0, 0 x4c, 0, 0 x45, 0 x43, 0 x40, 0 x3d, 0 x3a, 0 x38, 0 x35, 0 x33, 0 x30, 0 x2e, 0 x2b, 0 x29, 0 x27,
X22 0 x25, 0, 0 x20, 0 x1e, 0 x1c, 0 x1a, 0 x18, 0 x16, 0 x15, 0 x13, 0 x11, 0 x10, 0 x0e, 0 x0d, 0 x0b, 0 x0a,
X07 x09 0, 0 x08, 0, 0, x06 x05 0, 0 x04, 0 x03, 0 x02, 0 x02, 0 x01, 0 x00 to 0 x00 to 0 x00 to 0 x00 to 0 x00 to 0 x00,
0 x00 to 0 x00 to 0 x00 to 0 x00 to 0 x00 to 0 x00 to 0 x01, 0 x02, 0 x02, 0 x03, 0 x04, 0 x05, 0 x06, 0 x07, 0 x08, 0 x09,
0 x0a, 0 x0b, 0 x0d, 0 x0e, 0 x10, 0 x11, 0 x13, 0 x15, 0 x16, 0 x18, 0 x1a, 0 x1c, 0 x1e, 0 x20, x22 0, 0 x25,
X2b x27 0, 0 x29, 0, 0 x2e, 0 x30, 0 x33, 0 x35, 0 x38, 0 x3a, 0 x3d, 0 x40, 0 x43, 0 x45, 0 x48, 0 x4c, 0 x4e,
X55 0 x51, 0, 0 x57, 0 x5a, 0 x5d, 0 x60, 0 x63, 0 x66, 0 x69, 0 x6c, 0 x6f, 0 x72, 0 x76, 0 x79, 0 x7c, 0 x7e
};

Void Delay_MS (uint);//delay
Void stair (uchar AMP);//sawtooth
Void square (uchar AMP, uchar THL, uchar TLL);//square wave AMP THL current loop current maximum output TLL
Void trian uchar (AMP);//triangle wave
Void sin ();//sine wave
Void scan ();//scan function

Void delay (uint x)//delay function
{
Uint a, b;
For (a=x; A> 0; A -)
For (b=10; B> 0; B -);
}

Void delay1 (uint x)//delay function
{
Uint a, b;
For (a=x; A> 0; A -)
For (b=100; B> 0; B -);
}
//* * * * * * * * * * * * * * * * * * * * * * * * * * write command function * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void write_com (uchar com)
{
Wela=1;//latch who choose open
P0=com;//to P0 mouth write command
Wela=0;//latch who choose close

RS=0;//the following sections according to sequence diagrams write 1602 handbook
EN=0;
RW=0;
Delay (10);
EN=1;
Delay (10);
EN=0;
}
//* * * * * * * * * * * * * * * * * * * to write data function * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void write_date (uchar date) {
Wela=1;
P0=date;
Wela=0;
RS=1;
EN=0;
RW=0;
Delay (10);
EN=1;
Delay (10);
EN=0;

}
//* * * * * * * * * * * * * * * * * * * * * * * * initialization function * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void init ()
{
Write_com (0 x38);//three display mode Settings, not busy testing signal
Delay (5);
Write_com (0 x38);
Delay (5);
Write_com (0 x38);
Delay (5);

Write_com (0 x38);//display mode Settings, began to demand that busy testing signals: 8, 2, 5 x7 lattice
Write_com (0 x08);//disable display
Write_com (0 x01);//clear screen
Write_com (0 x06);//display the cursor Settings: text does not move, the cursor moves to the right automatically
Write_com (0 x0c);//display and cursor Settings: the cursor, the cursor is not flashing
}
Void main ()
{
While (1)
{
//one by one test
//stair (200);
//square,10,10 (200);
//trian (200);
//sin ();
Scan ();
}
}
Void tap1 ()
{
Uchar a;
init();
Write_com (0 x80);//the first line of the starting address
Delay (20);
For (a=0; a<14. +)
{
Write_date (table1 [a]);//read character table
Delay (20);
}
Write_com (0 xc0);//the second line of the starting address
Delay (20);
For (a=0; a<17. +)
{
Write_date (table5 [a]);//read character table
Delay (20);
}
while(1);//keep show
}

Void tap2 ()
{
Uchar a;
init();
Write_com (0 x80);//the first line of the starting address
Delay (20);
For (a=0; a<12. +)
{
Write_date (table2 [a]);//read character table
Delay (20);
}
Write_com (0 xc0);//the second line of the starting address
Delay (20);
For (a=0; a<17. +)
{
Write_date (table5 [a]);//read character table
Delay (20);
}
while(1);//keep show
}
Void tap3 ()
{
Uchar a;
init();
Write_com (0 x80);//the first line of the starting address
Delay (20);
For (a=0; a<16. +)
{
Write_date (table3 [a]);//read character table
Delay (20);
}
Write_com (0 xc0);//the second line of the starting address
Delay (20);
For (a=0; a<17. +)
{
Write_date (table5 [a]);//read character table
Delay (20);
}
while(1);//keep show
}
Void tap4 ()
{
Uchar a;
init();
Write_com (0 x80);//the first line of the starting address
Delay (20);
For (a=0; a<10; +)
{
Write_date (table4 [a]);//read character table
Delay (20);
}
Write_com (0 xc0);//the second line of the starting address
Delay (20);
For (a=0; a<17. +)
{
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related