Hi there! This is my firs post, so if there are any misshaps pls - don't be mad.
Q: In my App I have to drive a single Servo motor (Graupner C512). It should be connected on LPT port. The problem is that I don't have a clue how to do that. I thought about using Timer control but I've learned it tickes only in 55ms periods minimum (for that servo it should tick between 1 and 2ms in intervals of 0.1ms). I've been told to use timeGetTime API function or Sleep API function, but...don't know how!
The second thing is, I don't know how to send those ticks to LPT port (like LPT1, bit 0 or sometning).
Thank You! I see, what are you trying to tell me, but I still don' quite get it.
First: What does The API GetTickCout looks like?
Second: I don't know, how to make that code for sending ticks to LPT port
Maybe, if I explain my problem a little further, it will help you to explain it to me. So here goes:
Let say, I woul like to turn one LED diode, whitch is attached to LPT1 - pin D0, ON and OFF every 30ms. It should stay ON for 1.5ms.
(If I should look like using "astabile multivibrator" in electronic).
Thank you for the reply!
If I got it right, it should look like this:
Declare Function GetTickCount Lib "kernel32.dll" () As Long
Do
Start=GetTickCount
Do While GetTickCount < Start + 30 'setting bit to 0 (zero) for 30ms
output=0 'output bit D0 on LPT1
Loop
Start=GetTickCount
Do While GetTickCount < Start + 1.5 'setting bit to 1 (one) for 1.5ms
output=1
Loop
Loop
Where 1.5 can be presented as Long and deviated between 1.0 and 2.0ms.
Hi, guys!
Sorry, but I don't quite get it. Are those API functions? (timeSetEvent, QuerryPerformanceCounter,...)
I'm not really familliar with multimedia, but still... if this can be a good solution, I would like to know more, I really do.
And yes, I've tried that code above with GetTickCount API, but it caused some storm in my brain cells.
I put a couter in Do-Lopp just to see, how it works and redirect an output in the List box (just n=n+1 for each loop). Quess what - it didn't return the same value each time it loops (it varried for about 20%)!
Why?
If I may, I have 1 more Q:
How to make a Command button behave like this:
When I press it (and keep it pressed) the counter should increment its value, and when I depress it (let it go), it should stop. I was thinking about KeyDown or MouseDown event but ither of them wouldn't work.
I attached a file for you to look!