Skip to content

Instantly share code, notes, and snippets.

@volodymyrlut
Last active August 29, 2015 14:22
Show Gist options
  • Save volodymyrlut/88a92e3d6ec3f811b4eb to your computer and use it in GitHub Desktop.
Save volodymyrlut/88a92e3d6ec3f811b4eb to your computer and use it in GitHub Desktop.
if((mem_time>0)&&(mem_temp>0)){
if(time_stas <= mem_time){
lcd_init(16);
lcd_gotoxy(0,0);
PORTB.2=1;
most_sig_byte=spi(0x00);
delay_ms(10);
least_sig_byte=spi(0x00);
PORTB.2=0;
temperature=(most_sig_byte<<8) | least_sig_byte;
temperature=temperature &0x7FF8;
temperature=temperature>>4;
temperature -=24;
sprintf(Temp,"%d", time_spent);
lcd_puts(Temp);
if(temperature < mem_temp){
PORTC.4=1;
} else {
PORTC.4=0;
}
delay_ms(500);
time_stas +=500;
}else{
lcd_init(16);
lcd_gotoxy(0,0);
lcd_puts("stopped");
PORTC.4=0;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment