| Line 1... |
Line 1... |
| 1 |
/**** IR Mrakomer3 ****/ |
1 |
/**** IR Mrakomer3 ****/ |
| 2 |
#define VERSION "3.0" |
2 |
#define VERSION "3.0" |
| 3 |
#define ID "$Id: irmrak3.c 929 2007-12-24 10:00:11Z kakl $" |
3 |
#define ID "$Id: irmrak3.c 930 2007-12-24 10:02:51Z kakl $" |
| 4 |
#include "irmrak3.h" |
4 |
#include "irmrak3.h" |
| 5 |
#bit SSPM3=0x14.3 |
- |
|
| 6 |
|
5 |
|
| 7 |
#define SA 0x00 // Slave Address (0 for single slave / 0x5A<<1 default) |
6 |
#define SA 0x00 // Slave Address (0 for single slave / 0x5A<<1 default) |
| 8 |
#define RAM_Access 0x00 // RAM access command |
7 |
#define RAM_Access 0x00 // RAM access command |
| 9 |
#define RAM_Tobj1 0x07 // To1 address in the eeprom |
8 |
#define RAM_Tobj1 0x07 // To1 address in the eeprom |
| 10 |
#define RAM_Tamb 0x06 // Ta address in the eeprom |
9 |
#define RAM_Tamb 0x06 // Ta address in the eeprom |
| Line 126... |
Line 125... |
| 126 |
setup_timer_2(T2_DISABLED,0,1); |
125 |
setup_timer_2(T2_DISABLED,0,1); |
| 127 |
setup_comparator(NC_NC_NC_NC); |
126 |
setup_comparator(NC_NC_NC_NC); |
| 128 |
setup_vref(FALSE); |
127 |
setup_vref(FALSE); |
| 129 |
setup_oscillator(OSC_4MHZ|OSC_INTRC); |
128 |
setup_oscillator(OSC_4MHZ|OSC_INTRC); |
| 130 |
|
129 |
|
| 131 |
// SSPM3=1; |
- |
|
| 132 |
|
- |
|
| 133 |
delay_ms(1000); |
130 |
delay_ms(1000); |
| 134 |
printf("\n\r* Mrakomer %s (C) 2007 KAKL *\n\r",VER); // Welcome message |
131 |
printf("\n\r* Mrakomer %s (C) 2007 KAKL *\n\r",VER); // Welcome message |
| 135 |
printf("* %s *\n\r\n\r",REV); |
132 |
printf("* %s *\n\r\n\r",REV); |
| 136 |
tempa=ReadTemp(SA, RAM_Tamb); // Dummy read |
133 |
tempa=ReadTemp(SA, RAM_Tamb); // Dummy read |
| 137 |
temp=ReadTemp(SA, RAM_Tobj1); |
134 |
temp=ReadTemp(SA, RAM_Tobj1); |
| Line 143... |
Line 140... |
| 143 |
{ |
140 |
{ |
| 144 |
n++; |
141 |
n++; |
| 145 |
|
142 |
|
| 146 |
if (kbhit()) // Would you like warmer? |
143 |
if (kbhit()) // Would you like warmer? |
| 147 |
{ |
144 |
{ |
| 148 |
getc(); i=0; |
145 |
getc(); i=0; |
| 149 |
} |
146 |
} |
| 150 |
|
147 |
|
| 151 |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |
148 |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |
| 152 |
temp=ReadTemp(SA, RAM_Tobj1); |
149 |
temp=ReadTemp(SA, RAM_Tobj1); |
| 153 |
|
150 |
|