Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
1 a 100000 1111111111 11111111111111111111111111 10000000
UART1_Read_Text(output, "m", 255);
sbit SH_CP at RD0_bit;
sbit SH_CP_Direction at TRISD0_bit;
sbit ST_CP at RD2_bit;
sbit ST_CP_Direction at TRISD2_bit;
sbit DS at RD1_bit;
sbit DS_Direction at TRISD1_bit;
char uart_rd;
char output[7];
unsigned char value12hc595 = 0, value22hc595 = 0;
void interrupt() {
if(RCIF_bit) {
if(OERR_bit) {
CREN_bit = 0;
CREN_bit = 1;
OERR_bit = 0;
}
//uart_rd = UART1_Read();
UART1_Read_Text(output, "m", 255);
RCIF_bit = 0;
}
}
void SPI_Send(unsigned char s1, unsigned char s2) {
unsigned char mask;
char i = 0;
mask = 0x20;
for(i = 0; i < 6; i++, mask >>= 1) {
if(s1 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
DS = 1;
for(i = 0; i < 36; i++) {
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s2 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
ST_CP = 1;
Delay_ms(5);
ST_CP = 0;
}
void main() {
CMCON = 0x07;
ADCON1 = 0x87;
TRISA = 0xC0;
TRISB = 0x00;
TRISC = 0x80;
TRISD = 0x00;
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
SH_CP_Direction = 0;
SH_CP = 0;
ST_CP_Direction = 0;
ST_CP = 0;
DS_Direction = 0;
DS = 0;
SPI_Send(0b000000, 0b00000000);
UART1_Init(9615);
Delay_ms(200);
UART1_Write_Text("send characters");
RCIF_bit = 0;
RCIE_bit = 1;
PEIE_bit = 1;
GIE_bit = 1;
while(1) {
if(output) {
switch(output) {
case 'a':
value12hc595 = 0b100000;
value22hc595 = 0b10000000;
break;
case 'b':
value12hc595 = 0b101000;
value22hc595 = 0b01000000;
break;
case 'c':
value12hc595 = 0b110000;
value22hc595 = 0b00100000;
break;
case 'd':
value12hc595 = 0b110100;
value22hc595 = 0b00010000;
break;
case 'e':
value12hc595 = 0b100100;
value22hc595 = 0b00001000;
break;
case 'f':
value12hc595 = 0b111000;
value22hc595 = 0b00000100;
break;
case 'g':
value12hc595 = 0b111100;
value22hc595 = 0b00000010;
break;
case 'h':
value12hc595 = 0b101100;
value22hc595 = 0b00000001;
break;
case 'i':
value12hc595 = 0b011000;
value22hc595 = 0b11000000;
break;
case 'j':
value12hc595 = 0b011000;
value22hc595 = 0b01100000;
break;
case 'k':
value12hc595 = 0b100010;
value22hc595 = 0b00110000;
break;
case 'l':
value12hc595 = 0b101010;
value22hc595 = 0b00011000;
break;
case 'm':
value12hc595 = 0b110010;
value22hc595 = 0b00001100;
break;
case 'n':
value12hc595 = 0b110110;
value22hc595 = 0b00000110;
break;
case 'o':
value12hc595 = 0b100110;
value22hc595 = 0b00000011;
break;
case 'p':
value12hc595 = 0b111010;
value22hc595 = 0b10000001;
break;
case 'q':
value12hc595 = 0b111110;
value22hc595 = 0b11100000;
break;
case 'r':
value12hc595 = 0b101110;
value22hc595 = 0b01110000;
break;
case 's':
value12hc595 = 0b011010;
value22hc595 = 0b00111000;
break;
case 't':
value12hc595 = 0b011110;
value22hc595 = 0b00011100;
break;
case 'u':
value12hc595 = 0b100011;
value22hc595 = 0b00001110;
break;
case 'v':
value12hc595 = 0b101011;
value22hc595 = 0b00000111;
break;
case 'w':
value12hc595 = 0b011101;
value22hc595 = 0b10000011;
break;
case 'x':
value12hc595 = 0b110011;
value22hc595 = 0b11000001;
break;
case 'y':
value12hc595 = 0b110111;
value22hc595 = 0b11110000;
break;
case 'z':
value12hc595 = 0b101110;
value22hc595 = 0b01111000;
break;
case '0':
value12hc595 = 0b011100;
value22hc595 = 0b00111100;
break;
case '1':
value12hc595 = 0b100000;
value22hc595 = 0b00011110;
break;
case '2':
value12hc595 = 0b101000;
value22hc595 = 0b00001111;
break;
case '3':
value12hc595 = 0b110000;
value22hc595 = 0b10000111;
break;
case '4':
value12hc595 = 0b110100;
value22hc595 = 0b11000011;
break;
case '5':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
}
SPI_Send(value12hc595, value22hc595);
output = 0;
}
}
}
This is completely useless information without telling the error and where it occurs.compiling this gives an error
sbit SH_CP at RD0_bit;
sbit SH_CP_Direction at TRISD0_bit;
sbit ST_CP at RD2_bit;
sbit ST_CP_Direction at TRISD2_bit;
sbit DS at RD1_bit;
sbit DS_Direction at TRISD1_bit;
char uart_rd;
char output[7];
unsigned char value12hc595 = 0, value22hc595 = 0, value23hc595 = 0, value24hc595 = 0, value25hc595 = 0, value26hc595 = 0, value27hc595 = 0;
int i = 0;
int x = 0;
bit flag, flag1;
void interrupt() {
if(RCIF_bit) {
if(OERR_bit) {
CREN_bit = 0;
CREN_bit = 1;
OERR_bit = 0;
flag=1;
}
} }
void SPI_Send2(unsigned char s1, unsigned char s3, unsigned char s4, unsigned char s5, unsigned char s6, unsigned char s7, unsigned char s2) {
unsigned char mask;
char i = 0;
mask = 0x20;
for(i = 0; i < 6; i++, mask >>= 1) {
if(s1 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s3 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s4 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s5 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s6 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x08;
for(i = 0; i < 4; i++, mask >>= 1) {
if(s7 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
//////////////////////////
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s2 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
ST_CP = 1;
Delay_ms(5);
ST_CP = 0;
}
void main() {
CMCON = 0x07;
ADCON1 = 0x87;
TRISA = 0xC0;
TRISB = 0x00;
TRISC = 0x80;
TRISD = 0x00;
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
SH_CP_Direction = 0;
SH_CP = 0;
ST_CP_Direction = 0;
ST_CP = 0;
DS_Direction = 0;
DS = 0;
UART1_Init(9615);
Delay_ms(200);
UART1_Write_Text("send characters");
RCIF_bit = 0;
RCIE_bit = 1;
PEIE_bit = 1;
GIE_bit = 1;
while(1) {
if(flag) {
char output[7];
UART1_Read_Text(output, "m", 255);
switch(uart_rd) {
case 'a':
value12hc595 = 0b100000;
value22hc595 = 0b10000000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'b':
value12hc595 = 0b101000;
value22hc595 = 0b01000000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'c':
value12hc595 = 0b110000;
value22hc595 = 0b00100000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'd':
value12hc595 = 0b110100;
value22hc595 = 0b00010000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'e':
value12hc595 = 0b100100;
value22hc595 = 0b00001000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'f':
value12hc595 = 0b111000;
value22hc595 = 0b00000100;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'g':
value12hc595 = 0b111100;
value22hc595 = 0b00000010;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'h':
value12hc595 = 0b101100;
value22hc595 = 0b00000001;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'i':
value12hc595 = 0b011000;
value22hc595 = 0b11000000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'j':
value12hc595 = 0b011000;
value22hc595 = 0b01100000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'k':
value12hc595 = 0b100010;
value22hc595 = 0b00110000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'l':
value12hc595 = 0b101010;
value22hc595 = 0b00011000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'm':
value12hc595 = 0b110010;
value22hc595 = 0b00001100;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'n':
value12hc595 = 0b110110;
value22hc595 = 0b00000110;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'o':
value12hc595 = 0b100110;
value22hc595 = 0b00000011;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'p':
value12hc595 = 0b111010;
value22hc595 = 0b10000001;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'q':
value12hc595 = 0b111110;
value22hc595 = 0b11100000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'r':
value12hc595 = 0b101110;
value22hc595 = 0b01110000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 's':
value12hc595 = 0b011010;
value22hc595 = 0b00111000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 't':
value12hc595 = 0b011110;
value22hc595 = 0b00011100;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'u':
value12hc595 = 0b100011;
value22hc595 = 0b00001110;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'v':
value12hc595 = 0b101011;
value22hc595 = 0b00000111;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'w':
value12hc595 = 0b011101;
value22hc595 = 0b10000011;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'x':
value12hc595 = 0b110011;
value22hc595 = 0b11000001;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'y':
value12hc595 = 0b110111;
value22hc595 = 0b11110000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case 'z':
value12hc595 = 0b101110;
value22hc595 = 0b01111000;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '0':
value12hc595 = 0b011100;
value22hc595 = 0b00111100;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '1':
value12hc595 = 0b100000;
value22hc595 = 0b00011110;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '2':
value12hc595 = 0b101000;
value22hc595 = 0b00001111;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '3':
value12hc595 = 0b110000;
value22hc595 = 0b10000111;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '4':
value12hc595 = 0b110100;
value22hc595 = 0b11000011;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
case '5':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
value23hc595 = 0b10000000;
value24hc595 = 0b10000000;
value25hc595 = 0b10000000;
value26hc595 = 0b10000000;
value27hc595 = 0b1000;
break;
}
SPI_Send2(value12hc595, value22hc595, value23hc595, value24hc595,value25hc595, value26hc595,value27hc595);
uart_rd = 0;
}
}
}
Sl No Case Binary to shift
1 a 100000 1111111111 11111111111111111111111111 10000000
2 b 101000 1111111111 11111111111111111111111111 01000000
3 d 110100 1111111111 11111111111111111111111111 00010000
4 e 100100 1111111111 11111111111111111111111111 00001000
5 g 111100 1111111111 11111111111111111111111111 00000010
6 h 101100 1111111111 11111111111111111111111111 00000001
7 i 011000 1111111111 11111111111111111111111111 11000000
8 j 011000 1111111111 11111111111111111111111111 01100000
9 k 100010 1111111111 11111111111111111111111111 00110000
10 l 101010 1111111111 11111111111111111111111111 00011000
11 m 110010 1111111111 11111111111111111111111111 00001100
12 n 110110 1111111111 11111111111111111111111111 00000110
13 o 100110 1111111111 11111111111111111111111111 00000011
14 p 111010 1111111111 11111111111111111111111111 10000001
15 q 111110 1111111111 11111111111111111111111111 11100000
16 w 011101 1111111111 11111111111111111111111111 10000011
17 x 110011 1111111111 11111111111111111111111111 11000001
18 y 110111 1111111111 11111111111111111111111111 11110000
19 z 101110 1111111111 11111111111111111111111111 01111000
20 0 011100 1111111111 11111111111111111111111111 00111100
21 1 100000 1111111111 11111111111111111111111111 00011110
22 2 101000 1111111111 11111111111111111111111111 00001111
23 3 110000 1111111111 11111111111111111111111111 10000111
24 4 110100 1111111111 11111111111111111111111111 11000011
25 5 100100 1111111111 11111111111111111111111111 11100001
26 6 111000 1111111111 11111111111111111111111111 11110000
27 7 111100 1111111111 11111111111111111111111111 01111000
28 8 101100 1111111111 11111111111111111111111111 00111100
29 apple 100000 111010 111010 101010 100100 000000 000000 00011110
30 jocker 011100 100110 110000 100010 100100 101110 000000 00001111
31 honey 101100 100110 110110 100100 110111 000000 000000 10000111
32 eagle 100100 101111 111100 101010 100100 000000 000000 11000011
milan.rajik said:varunme said:can you help me in altering the code?
Yes, I can help but only if you can provide the correct binary sequences.
sbit SH_CP at RD0_bit;
sbit SH_CP_Direction at TRISD0_bit;
sbit ST_CP at RD2_bit;
sbit ST_CP_Direction at TRISD2_bit;
sbit DS at RD1_bit;
sbit DS_Direction at TRISD1_bit;
char uart_rd;
char output[7];
unsigned char value12hc595 = 0, value22hc595 = 0;
bit flag;
void interrupt() {
if(RCIF_bit) {
if(OERR_bit) {
CREN_bit = 0;
CREN_bit = 1;
OERR_bit = 0;
}
//uart_rd = UART1_Read();
flag=1;
RCIF_bit = 0;
}
}
void SPI_Send(unsigned char s1, unsigned char s2) {
unsigned char mask;
char i = 0;
mask = 0x20;
for(i = 0; i < 6; i++, mask >>= 1) {
if(s1 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0b100000000000000000000000000000000000;
for(i = 0; i < 36; i++, mask >>= 1) {
if(s1 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
mask = 0x80;
for(i = 0; i < 8; i++, mask >>= 1) {
if(s2 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}
ST_CP = 1;
Delay_ms(5);
ST_CP = 0;
}
void main() {
CMCON = 0x07;
ADCON1 = 0x87;
TRISA = 0xC0;
TRISB = 0x00;
TRISC = 0x80;
TRISD = 0x00;
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
SH_CP_Direction = 0;
SH_CP = 0;
ST_CP_Direction = 0;
ST_CP = 0;
DS_Direction = 0;
DS = 0;
SPI_Send(0b000000, 0b00000000);
UART1_Init(9615);
Delay_ms(200);
UART1_Write_Text("send characters");
RCIF_bit = 0;
RCIE_bit = 1;
PEIE_bit = 1;
GIE_bit = 1;
while(1) {
if(flag) {
UART1_Read_Text(output, "m", 255);
switch(output[7]) {
case 'a':
value12hc595 = 0b100000;
value22hc595 = 0b10000000;
break;
case 'b':
value12hc595 = 0b101000;
value22hc595 = 0b01000000;
break;
case 'c':
value12hc595 = 0b110000;
value22hc595 = 0b00100000;
break;
case 'd':
value12hc595 = 0b110100;
value22hc595 = 0b00010000;
break;
case 'e':
value12hc595 = 0b100100;
value22hc595 = 0b00001000;
break;
case 'f':
value12hc595 = 0b111000;
value22hc595 = 0b00000100;
break;
case 'g':
value12hc595 = 0b111100;
value22hc595 = 0b00000010;
break;
case 'h':
value12hc595 = 0b101100;
value22hc595 = 0b00000001;
break;
case 'i':
value12hc595 = 0b011000;
value22hc595 = 0b11000000;
break;
case 'j':
value12hc595 = 0b011000;
value22hc595 = 0b01100000;
break;
case 'k':
value12hc595 = 0b100010;
value22hc595 = 0b00110000;
break;
case 'l':
value12hc595 = 0b101010;
value22hc595 = 0b00011000;
break;
case 'm':
value12hc595 = 0b110010;
value22hc595 = 0b00001100;
break;
case 'n':
value12hc595 = 0b110110;
value22hc595 = 0b00000110;
break;
case 'o':
value12hc595 = 0b100110;
value22hc595 = 0b00000011;
break;
case 'p':
value12hc595 = 0b111010;
value22hc595 = 0b10000001;
break;
case 'q':
value12hc595 = 0b111110;
value22hc595 = 0b11100000;
break;
case 'r':
value12hc595 = 0b101110;
value22hc595 = 0b01110000;
break;
case 's':
value12hc595 = 0b011010;
value22hc595 = 0b00111000;
break;
case 't':
value12hc595 = 0b011110;
value22hc595 = 0b00011100;
break;
case 'u':
value12hc595 = 0b100011;
value22hc595 = 0b00001110;
break;
case 'v':
value12hc595 = 0b101011;
value22hc595 = 0b00000111;
break;
case 'w':
value12hc595 = 0b011101;
value22hc595 = 0b10000011;
break;
case 'x':
value12hc595 = 0b110011;
value22hc595 = 0b11000001;
break;
case 'y':
value12hc595 = 0b110111;
value22hc595 = 0b11110000;
break;
case 'z':
value12hc595 = 0b101110;
value22hc595 = 0b01111000;
break;
case '0':
value12hc595 = 0b011100;
value22hc595 = 0b00111100;
break;
case '1':
value12hc595 = 0b100000;
value22hc595 = 0b00011110;
break;
case '2':
value12hc595 = 0b101000;
value22hc595 = 0b00001111;
break;
case '3':
value12hc595 = 0b110000;
value22hc595 = 0b10000111;
break;
case '4':
value12hc595 = 0b110100;
value22hc595 = 0b11000011;
break;
case '5':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
case '!':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
case '@':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
case '#':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
case '%':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
case '%':
value12hc595 = 0b100100;
value22hc595 = 0b11100001;
break;
}
SPI_Send(value12hc595, value22hc595);
//output[] = 0;
}
}
}
mask = 0b100000000000000000000000000000000000;
for(i = 0; i < 36; i++, mask >>= 1) {
if(s1 & mask)
DS = 1;
else
DS = 0;
SH_CP = 1;
Delay_ms(5);
SH_CP = 0;
}