Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DELAY 2
- int zn;
- int i;
- void main()
- {
- ANSELC = 0;
- TRISC = 16;
- UART1_Init(38400);
- while(1)
- {
- zn = 0;
- if(PORTC & 16)
- {
- Delay_ms(3);
- for(i = 0; i < 8; i++)
- {
- if(PORTC & 16)
- {
- zn = (zn << 1) | 1;
- LATB = 1;
- }
- else
- {
- zn <<= 1;
- LATB = 0;
- }
- Delay_ms(2);
- }
- LATB = 0;
- UART1_Write(zn);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement