Created
December 14, 2015 05:01
-
-
Save giacobo1/7d4bbb5fb65b873d55a6 to your computer and use it in GitHub Desktop.
Revisions
-
giacobo1 renamed this gist
Dec 14, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
giacobo1 created this gist
Dec 14, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #include <stdlib.h> #include <stdio.h> short PWM1_SET_DUTY( short cont, short q, short MAX ) { if (cont >=0 && cont < MAX) { cont += q; } return cont; } int main(int argc, char * argv[]) { short cont = 0; int i = 0; for (i; i < atoi(argv[1]); i++) { cont = PWM1_SET_DUTY(cont, 25, 255); } printf("%d\n", cont); return 0; }