diff -r 9e2addbb9674 -r 254d5d1bc659 c++/lpt-signal-generator/lpt.cpp --- a/c++/lpt-signal-generator/lpt.cpp Fri Jun 09 23:23:25 2017 +0200 +++ b/c++/lpt-signal-generator/lpt.cpp Sun Jun 11 01:25:56 2017 +0200 @@ -56,7 +56,7 @@ int addr = 0xe400; // parallel port address; first number of given port in: cat /proc/ioports | grep parport int baseFreq = 10000; // base frequency in Hz, should be between 5 000 between 10 000 Hz; lower frequency leads to dashed/dotted lines instead of greyscale - int outputPower = 10; // duty cycle; 100 = 100 % + int outputPower = 20; // duty cycle; 100 = 100 % int duration = 1; // in seconds; total sleep time, see note above int valueWidth = 10; // just for padding of printed values @@ -74,6 +74,9 @@ int timeOn = oneSecond * outputPower / 100 / baseFreq; int timeOff = oneSecond * (100 - outputPower) / 100 / baseFreq; + timeOn -= 13; + timeOff -= 13; + int cycleCount = duration * baseFreq; wprintf(L"%*ls %'*d ×\n", labelWidth, L"Cycle count:", valueWidth, cycleCount); wprintf(L"%*ls %'*d μs 1× in each cycle\n", labelWidth, L"Time on:", valueWidth, timeOn);