|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-10-17 09:03:22
|
显示全部楼层
看来得自己顶了,边学边试,一天写几行吧。- #include <iom8v.h>
- #include <macros.h>
- #define uchar unsigned char
- #define uint unsigned int
- #define ADC_START ADCSRA |= 0x40
- #define SENSOR_DATA_NUM 18
- #define SENSOR_DATA_INDEX_NUM 6
- #pragma interrupt_handler timer0:10
- const uint sensor_tempera_table[SENSOR_DATA_NUM] =
- {200,500,700,1000,1300,1500,1800,2000,2300,2500,2800,3050,3350,3550,3750,3950,4150,4350 //10 times of actual value
- };
- const uint sensor_voltage_table[SENSOR_DATA_NUM] =
- {100,270,380,560, 720, 840, 1040,1180,1350,1500,1730,1900,2100,2260,2420,2580,2740,2900 //5 times of actual value
- };
- const uint voltage_table_index[SENSOR_DATA_INDEX_NUM] =
- {380,840,1350,1900,2420,2900};
复制代码 |
|