hongbin2132 发表于 2010-8-24 10:26:16

关于c8051f020温度测量疑问

请问大家关于C8051F020的程序温度测量的
   while (1) {
      EA = 0;                        // disable interrupts
      temperature = result;
      EA = 1;                        // re-enable interrupts

      // calculate temperature in hundredths of a degree
      temperature = temperature - 41380;
      temperature = (temperature * 100L) / 156;
      temp_int = temperature / 100;
      temp_frac = temperature - (temp_int * 100);
      printf ("Temperature is %+02d.%02d\n", temp_int, temp_frac);

      LED = ~SW1;                      // LED reflects state of switch
   }

关于temperature装换 请问哪位高手可以解释下 看不懂

陈远鹏 发表于 2013-8-1 18:47:35

同求!!!!!!!!!!!!!!!

fastweb 发表于 2013-8-1 18:53:24

片内温度传感器?参考手册上已经很详细。
页: [1]
查看完整版本: 关于c8051f020温度测量疑问