| 数据搜索系统,热门电子元器件搜索 |
|
SEN0244 数据表(PDF) 5 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
SEN0244 数据表(HTML) 5 Page - DFROBOT |
|
5 / 7 page ![]() void loop() { static unsigned long analogSampleTimepoint = millis(); if(millis()-analogSampleTimepoint > 40U) //every 40 milliseconds,re ad the analog value from the ADC { analogSampleTimepoint = millis(); analogBuffer[analogBufferIndex] = analogRead(TdsSensorPin); //read the analog value and store into the buffer analogBufferIndex++; if(analogBufferIndex == SCOUNT) analogBufferIndex = 0; } static unsigned long printTimepoint = millis(); if(millis()-printTimepoint > 800U) { printTimepoint = millis(); for(copyIndex=0;copyIndex<SCOUNT;copyIndex++) analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; averageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * (float)VREF / 1024.0; // read the analog value more stable by the median filtering alg orithm, and convert to voltage value float compensationCoefficient=1.0+0.02*(temperature-25.0); //temp erature compensation formula: fFinalResult(25^C) = fFinalResult(current)/( 1.0+0.02*(fTP-25.0)); float compensationVolatge=averageVoltage/compensationCoefficient; / /temperature compensation tdsValue=(133.42*compensationVolatge*compensationVolatge*compensatio nVolatge - 255.86*compensationVolatge*compensationVolatge + 857.39*compens ationVolatge)*0.5; //convert voltage value to tds value //Serial.print("voltage:"); //Serial.print(averageVoltage,2); //Serial.print("V "); Serial.print("TDS Value:"); Serial.print(tdsValue,0); Serial.println("ppm"); } |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |