Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (1)
- {
- // Place your code here
- lcd_clear();
- delay_ms(1000);
- data = 0;
- PORTB.2=0;
- //select the TC77
- for(i=13; i>0; i--){
- PORTB.5 = 1;
- //clock
- delay_us(10);
- PORTB.5 = 0;
- delay_us(10);
- temp[i-1] = PORTB.3;
- }
- delay_ms(500);
- PORTB.2 = 1; //deselect the TC77
- data >>= 6; //to get rid of the fraction of a degree
- sprintf(buffer,"temp: %lu C",data);
- lcd_puts(buffer);
- delay_ms(1000);
- lcd_gotoxy(1,1);
- lcd_puts(temp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement