Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Number of joystick presses per second.

Author
Message
pizza
22
Years of Service
User Offline
Joined: 21st Sep 2002
Location: Canada
Posted: 12th Feb 2003 21:55
Hello, i'm trying to test my different controllers and see how many times the buttons can be pushed per second. I'm thinking that USB controllers will respond better, and allow you to push faster and have the computer read every press, and that older, serial joysticks can only send so many signals per second. Anyway, i'd like to figure this out using dark basic pro. I have some ideas as to how i would do it, but i'm not certain about how the Timer() command would be used properly, and an accurate rate will be returned.

Any comments, or tips would be very appreciated.
Thanks!
pizza
22
Years of Service
User Offline
Joined: 21st Sep 2002
Location: Canada
Posted: 12th Feb 2003 22:05
I think i'm about to solve it. It just popped into my head. I need to put it into Dark Basic.

pizza
22
Years of Service
User Offline
Joined: 21st Sep 2002
Location: Canada
Posted: 12th Feb 2003 22:33
Here's some possibly unoptimized code:
I'm not sure if i'm doing a lot of things that Dark Basic does automatically, or if i'm going about calculating anything inefficiently. Anyone have any suggestions?



pizza
22
Years of Service
User Offline
Joined: 21st Sep 2002
Location: Canada
Posted: 12th Feb 2003 23:08
I'm going to keep working it out in my mind, i'm thinking of using an array to store the last 3 results and keep an average of just the last 3, for a quicker (and more representitive) response from the averaging output.
This thread is no longer for me to get answers, although i'm open to suggestions, it's now about the function of the code and for whoever may want it.

pizza
22
Years of Service
User Offline
Joined: 21st Sep 2002
Location: Canada
Posted: 12th Feb 2003 23:24
Well, here it is! (anyone out there?)




I'm pretty happy with this code, i think it does it all correctly. If anyone finds a problem, plz let me know.

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Feb 2003 00:38
serial and usb (which is really just a faster serial) work to a burst signal - running at a speed you set.
i've noticed the past week with quite a few periphirals that the standard for PCs is 6mhz (60hz) which is around 166ms information burst ... and for older systems like the Amiga, Spectrum etc - it is usually set to the same as the system bus, being only a few Mhz

this means potentially per second the joystick/joypad will send data around 6x per second.
should be more than enough (^_^)

that certainly seems an interesting why to check for it though

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2025-05-18 13:44:48
Your offset time is: 2025-05-18 13:44:48