//Designs/MRAKOMER3/SW/irmrak3.c |
---|
143,10 → 143,9 |
{ |
n++; |
if (kbhit()) |
if (kbhit()) // Would you like warmer? |
{ |
delay_ms(200); |
if ('w'==getc()) i=0; // Would you like warmer? |
getc(); i=0; |
} |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |
154,7 → 153,7 |
if((0==tempa)||(0==temp)) // Transfer error? |
{ |
printf("%Lu;ta:-273;ts:-273;Error\n\r",n); |
printf("%Lu;ta:-273;ts:-273;sta:-1\n\r",n); |
output_low(HEATING); |
} |
else |
162,15 → 161,15 |
to=(signed int16)(temp*2-27315)/100; |
ta=(signed int16)(tempa*2-27315)/100; |
printf("%Lu;ta:%Ld;ts:%Ld;",n,ta,to); |
printf("%Lu;ta:%Ld;ts:%Ld;sta:",n,ta,to); |
if (i>=MAXHEAT) |
{ |
printf("OK\n\r"); |
printf("0\n\r"); |
output_low(HEATING); |
} |
else |
{ |
printf("Heating\n\r"); |
printf("1\n\r"); |
output_high(HEATING); |
i++; |
} |
//Designs/MRAKOMER3/SW/irmrak3.h |
---|
15,6 → 15,6 |
#FUSES NOIESO //Internal External Switch Over mode disabled |
#use delay(clock=4000000) |
#use rs232(baud=2400,parity=N,xmit=PIN_B5,rcv=PIN_B2,bits=8) |
#use i2c(Master,Slow,sda=PIN_B1,scl=PIN_B4,SMBUS)//,force_hw) |
#use rs232(baud=2400,parity=N,xmit=PIN_B5,rcv=PIN_B2,bits=8,FORCE_SW) |
#use i2c(MASTER,SLOW,sda=PIN_B1,scl=PIN_B4,SMBUS)//,force_hw) |