ユーザ用ツール

サイト用ツール


softdev:tempmeter3

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
softdev:tempmeter3 [2013/01/07 23:49] – [ソース] kingsoftdev:tempmeter3 [2013/07/15 20:25] (現在) – 外部編集 127.0.0.1
行 65: 行 65:
  ADON = 1;  ADON = 1;
  
 +</code>
 +
 +ADC計算部(ごめん、long使ってる)
 +<code c>
 +char avg,fugo,d3,d2,d1,loop;
 +int andata,temp;
 +long temp10; // AD変換値の10倍で途中まで計算(long型とする)
 +
 +andata = 0;
 +for(avg=0;avg<HEIKIN;avg++){
 +  __delay_ms(5);
 +  GO = 1;
 +  while(GO);
 +  andata += (ADRESH<<8) | ADRESL ;
 +}
 +andata = andata / HEIKIN ;
 +temp10 = (long)andata * 5000 - 2457600;
 +temp10 =  temp10 / 4096;
 +temp   = (int)temp10;
 </code> </code>
  
  
  
softdev/tempmeter3.1357570199.txt.gz · 最終更新: 2013/07/15 20:28 (外部編集)