ADS1118 测试温度 arduino程序 验证OK


#include "Ads1118.h"
#include
#define CS 5


Ads1118 ads1118(CS); 

void setup(){

    ads1118.begin();

     Serial..begin(9600);

    while(!Serial); // wait for serial to come up
}


void loop(){
    Serial.println("Reading temperature");
    Serial.println(ads1118.readTemp(), DEC);


    Serial.println(ads1118.adsRead(ads1118.AIN1), DEC);


    Serial.println();


    delay(1000);
}

你可能感兴趣的:(Arduino,IC,区别,发现)