Portál AbcLinuxu, 30. dubna 2025 18:44
if (temp<40) { fprintf(f,"100"); #ifdef DEBUG printf("PWM set to 100\n"); #endif } else if (temp<50) { fprintf(f,"150"); #ifdef DEBUG printf("PWM set to 150\n"); #endif } else if (temp<60) { fprintf(f,"200"); #ifdef DEBUG printf("PWM set to 200\n"); #endif } else { fprintf(f,"240"); #ifdef DEBUG printf("PWM set to 240\n"); #endif }napsat nejak takhle:
if (temp<40) { hodnota=100; } else if (temp<50) { hodnota=150; } else if (temp<60) { hodnota=200; } else { hodnota=240; } fprintf(f,hodnota); #ifdef DEBUG printf("PWM set to %d\n", hodnota); #endif
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.