some things are working but regulation is fucked!

This commit is contained in:
2025-05-13 17:51:47 +02:00
parent 643861529f
commit 5b329b710a
12 changed files with 429 additions and 64 deletions

44
file_print.c Normal file
View File

@@ -0,0 +1,44 @@
/*
* file_print.c
*
* Created on: 13. maj 2025
* Author: Christian L. V. Madsen (OZ1CM)
*/
#include "file_print.h"
#include <stdio.h>
#include <string.h>
FILE *fpt;
void cm_file_open(char *fileName, float vtarget){
fpt = fopen(fileName,"w+");
fprintf(fpt,"time_s, Vout, Power, Vtarget = %.2f \n",vtarget);
}
void cm_file_close(){
fclose(fpt);
}
void cm_file_print(float duty,float Rload, float Vout, float time){
fprintf(fpt,"%.3f, %.2f, %.2f, %.2f\n", time, Vout, Vout/Rload, duty);
}
void showProcentInCmd(float time, float simulate_target_time){
float time_left = time / simulate_target_time;
time_left *= 100;
printf("\r Progress: %.1f%%", time_left);
}