![]() |
Joystick Button programming
Hi guys,
I have run into a sort of stupid problem. I can't get the buttons on the joystick to work. Code:
if (p1_sw_top ==1)Code:
//Somewhere in the top of the file |
Re: Joystick Button programming
Is it compiling correctly? Before you start yelling, let me explain..... We were programming along over the weekend when things started going crazy on our robot. It took about 30 minutes before I realized that I was getting a compile error, but it was still building the .hex file for me to download even though it should abort. Double check for any error messages when you do your 'Make All' just in case.
Other than that, desk check your code and make sure you are actually getting to the the lines you are trying to run. Trust me, I've added the greatest routines ever written to some of my software over the years, only to have them not execute because I put them in the wrong place in my code. It's quite embarrassing when your boss is expecting to see a simulated missile attack show up on the screen and nothing happens! |
Re: Joystick Button programming
Hi,
Here is a couple of things to consider. 1. Try a different joystick to verify that is okay. 2. Modify the code to do something like this... Code:
if (p1_sw_top == 1)4. Try a different port to verify port 1 does not have a problem. Let us know what you have learned. Regards, ChuckB |
Re: Joystick Button programming
I have tried different ports, buttons, joysticks.. it still doesnt work. I do agree I did not check to see if it builds correctly, but how do I tell? Here is the last output summary when I was building:
Code:
Clean: Deleting intermediary and output files.Thanks for all the help you guys are offering, -Bharat |
Re: Joystick Button programming
Code:
if (p1_sw_top ==1)Code:
//Somewhere in the top of the file |
Re: Joystick Button programming
have you tried doing this?
Code:
if (p1_sw_top ==1)this way, if there's anything that would change pwm01's values, you will know, because the robot will still not move. if it does move, well then move on to another solution. |
| All times are GMT -5. The time now is 17:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi