Seeeduino XIAO a senzor teploty MAX6675

Odpovědět
Uživatelský avatar
Caster
Příspěvky: 380
Registrován: 11 zář 2019, 09:02
Reputation: 0

Seeeduino XIAO a senzor teploty MAX6675

Příspěvek od Caster » 22 pro 2021, 13:34

Trochu jsem zápasil se čtením teploty ze senzoru teploty MAX6675 + termočlánek K 800C připojený k Seeeduino XIAO. Programy nalezené googlem nefungovaly. Po připojení osciloskopu jsem zjistil, že čtou jen 8 bitů. Nakonec to bylo jednoduché, stačilo instalovat knihovnu MAX6675 a bylo to ;) .

Na obrázku je hodnota pro teplotu 25°C = 0x0320 >>3 * 0.25

Kód: Vybrat vše

// this example is public domain. enjoy!
// https://learn.adafruit.com/thermocouple/

#include "max6675.h"

int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

void setup() {
  Serial.begin(9600);

  Serial.println("MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
  
   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
//   Serial.print("F = ");
//   Serial.println(thermocouple.readFahrenheit());
 
   // For the MAX6675 to update, you must delay AT LEAST 250ms between reads!
   delay(1000);
}
Obrázek

Odpovědět

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 14 hostů