o: ActiveSupport::Cache::Entry :@compressedF:@value"•"�
| Designs/MRAKOMER3/SW/irmrak3.h | ||
|---|---|---|
| 15 | 15 |
#FUSES NOIESO //Internal External Switch Over mode disabled |
| 16 | 16 |
|
| 17 | 17 |
#use delay(clock=4000000) |
| 18 |
#use rs232(baud=2400,parity=N,xmit=PIN_B5,rcv=PIN_B2,bits=8) |
|
| 19 |
#use i2c(Master,Slow,sda=PIN_B1,scl=PIN_B4,SMBUS)//,force_hw)
|
|
| 18 |
#use rs232(baud=2400,parity=N,xmit=PIN_B5,rcv=PIN_B2,bits=8,FORCE_SW)
|
|
| 19 |
#use i2c(MASTER,SLOW,sda=PIN_B1,scl=PIN_B4,SMBUS)//,force_hw)
|
|
| 20 | 20 |
|
| Designs/MRAKOMER3/SW/irmrak3.c | ||
|---|---|---|
| 143 | 143 |
{
|
| 144 | 144 |
n++; |
| 145 | 145 |
|
| 146 |
if (kbhit()) |
|
| 146 |
if (kbhit()) // Would you like warmer?
|
|
| 147 | 147 |
{
|
| 148 |
delay_ms(200); |
|
| 149 |
if ('w'==getc()) i=0; // Would you like warmer?
|
|
| 148 |
getc(); i=0; |
|
| 150 | 149 |
} |
| 151 | 150 |
|
| 152 | 151 |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |
| ... | ... | |
| 154 | 153 |
|
| 155 | 154 |
if((0==tempa)||(0==temp)) // Transfer error? |
| 156 | 155 |
{
|
| 157 |
printf("%Lu;ta:-273;ts:-273;Error\n\r",n);
|
|
| 156 |
printf("%Lu;ta:-273;ts:-273;sta:-1\n\r",n);
|
|
| 158 | 157 |
output_low(HEATING); |
| 159 | 158 |
} |
| 160 | 159 |
else |
| ... | ... | |
| 162 | 161 |
to=(signed int16)(temp*2-27315)/100; |
| 163 | 162 |
ta=(signed int16)(tempa*2-27315)/100; |
| 164 | 163 |
|
| 165 |
printf("%Lu;ta:%Ld;ts:%Ld;",n,ta,to);
|
|
| 164 |
printf("%Lu;ta:%Ld;ts:%Ld;sta:",n,ta,to);
|
|
| 166 | 165 |
if (i>=MAXHEAT) |
| 167 | 166 |
{
|
| 168 |
printf("OK\n\r");
|
|
| 167 |
printf("0\n\r");
|
|
| 169 | 168 |
output_low(HEATING); |
| 170 | 169 |
} |
| 171 | 170 |
else |
| 172 | 171 |
{
|
| 173 |
printf("Heating\n\r");
|
|
| 172 |
printf("1\n\r");
|
|
| 174 | 173 |
output_high(HEATING); |
| 175 | 174 |
i++; |
| 176 | 175 |
} |