Saturday, August 21, 2010

Keyboard commands in VB6 for controlling a model tank.?

i am currently making a computer controlled model army tank, it is controlled by and onboard pico itx comp, that is on wireless lan that you rdp into to use...


my question is:


in the sample software for the kit used to control the tank is a main timer function, i am wanting to know if its possible to have a command to check if a key has been pushed, i.e. this will end up being


w = forward


a = left


s = back


d = right


nothing = clutch (motors both have no power)





all the movements are currently in radio buttons (9 total)


all i want to do is assign it so that a when a key is pushed it will switch on that radio button for the duration of the push (when its done will go back to its clutch position)


the timer also monitors inputs from the tanks conroller, controlls and set outputs for speed and switch functions. the controll kit is a vellemen k8055 if that helps.





let me know if i need more details !!





thanksKeyboard commands in VB6 for controlling a model tank.?
double click on the form..





in the code sid you'll have ';sub form load()'; code


form the menu bar there is tow combo box one with the ';form'; name which could be ';form1'; and other with the action code which it should be ';Load()'; change load to keydown or keyup or whatever key you like, this will make new method like the ';sub form_load()'; it could be like this ';sub form_keydown(keycode key)';





you can use the key parameter to know any key will pressed on the form.





see also.





http://www.dreamincode.net/forums/showto鈥?/a>





http://www.freevbcode.com/ShowMessage.as鈥?/a>





http://www.vbforums.com/showthread.php?p鈥?/a>

No comments:

Post a Comment