Raspberry Pico Read Internal Temp with class

Rasspbery pi pico for ardunio studio.

class readSensor {
	public:
		void TempRead() {
		Serial.printf("Core temperature: %2.1fC\n", analogReadTemp());
    digitalWrite(LED_BUILTIN, HIGH);
    delay(100);
    digitalWrite(LED_BUILTIN, LOW);
		}
};

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  readSensor internalTemp;
  
	internalTemp.TempRead();
  delay(10000);
}

You may also like...

%d blogcu bunu beğendi: