39 lines
862 B
C
39 lines
862 B
C
/*
|
|
* main.c
|
|
*
|
|
* Created on: 14 Oct 2025
|
|
* Author: Christian L. V. Madsen (OZ1CM)
|
|
*/
|
|
#include "cm_heatsink_emulator/cm_heatsink_emulator.h"
|
|
|
|
#define POWER 600 // Watts
|
|
#define AMBIENT_TEMPERATURE 23 // degC
|
|
#define C_TH 32688.36649 // Thermal capacity
|
|
|
|
cm_heatsink_thermalElement_t thermElements[3] = {
|
|
{
|
|
.label = "LED To NTC",
|
|
.R_th = 0.002021944
|
|
},{
|
|
.label = "NTC To Heat sink",
|
|
.R_th = 0.015981191
|
|
},{
|
|
.label = "Heat sink To Ambient",
|
|
.R_th = 0.121949843
|
|
},
|
|
|
|
};
|
|
|
|
cm_heatsinkEmul_t thermEmul;
|
|
int main(void ){
|
|
|
|
// Init Thermal emulator
|
|
cm_heatsinkEmul_init(&thermEmul, thermElements,(sizeof(thermElements) / sizeof(thermElements[0])), C_TH, POWER, AMBIENT_TEMPERATURE);
|
|
|
|
cm_heatsinkEmul_iterate(&thermEmul, 32688.36649);
|
|
float t = cm_heatsinkEmul_getElementTemp(&thermEmul, 2);
|
|
printf("temp: %f\r\n", t);
|
|
return 0;
|
|
|
|
}
|