Miscellany
public c v1 · immutable#include <stdio.h>#include <stdlib.h>#include <math.h>int main(int argc, char *argv[]){ long F_CPU=(long)argv[0]; int RBAUD=(int)argv[1]; int pulse_res=F_CPU/256/RBAUD; char c; FILE *fone; fone = fopen("table.h","w+"); fprintf(fone,"const uint8_t sin_l[%d] PROGMEM={",pulse_res); for(c=0;c<pulse_res-1;c++) { fprintf(fone,"%d,",255*(1-cos(M_PI*c/pulse_res))/2); } c=pulse_res-1; fprintf(fone,"%d};",255*(1-cos(M_PI*c/pulse_res))/2); fclose(fone); //system("PAUSE"); return 0;}