This is a module that can measure temperature using thermocoupler K, J, T, N, E, S, B, and R type sensors.
1. #include “CFMEGA.h” library registration
2. CFNET object creation: CFNET object name
⇒ CFNET cfnet;
3. Use command:
Object Name.tcSetInit();
⇒ cfnet.tcSetInit(0,0);
Object Name.tcTempRead();
⇒ cfnet.tcTempRead(0);
This command sets the sensor type to be used for the address module specified as the initialization setting.
Reads the measured temperature value in float type to the second decimal place.
If the temperature sensor is not connected or disconnected, the value -1111 is returned.
#include "CFMEGA.h" CFNET cfnet; void setup() { Serial.begin(9600); cfnet.tcSetInit(0,0); cfnet.tcSetInit(1,0); } void loop() { float k_temp_0 = cfnet.tcTempRead(0); float k_temp_1 = cfnet.tcTempRead(1); Serial.print("Thermocouple 0 : "); Serial.print(k_temp_0); Serial.print("°C"); Serial.println(); Serial.print("Thermocouple 1 : "); Serial.print(k_temp_1); Serial.print("°C"); Serial.println(); Serial.println();Serial.println(); delay(200); }
You need to purchase a wire type sensor to connect this product. If you already have the connector type, open the connector and convert it to wire type.