![]() |
Spike relay mapped to gamepad trouble.
First, let me preface this with this : I am teaching myself java (uh-oh) I'm a mechanical mentor/ flight engineer who has only programmed HTML back when it was new (yikes!) closest to java I've ever been to was DHTM (remember that?).
I'm helping to start a new team to the north and I'm going to be relied upon to help teach the control system / programming among other things (everything else). It's my weakest area so I've decided to dive in. I've set up a complete control board in my dining room (- brownie points) as well as maybe a smallish robot I'm building as a demo bot (already has a weight problem). The problem I'm having is I mapped button 1 (A button) of a gamepad to turn on the spike (kOn) when pressed, and off at all other times. It worked. the problem now is I can't map it to any other button - I can try to map it to 2, or 3, or 4, push the code, re boot the c-Rio, power cycle, it's like button 1(A) has been hard wired to the spike on. even if I comment it out and push the code it still works?? :ahh: attached is my very simple spaghetti code - I'm sure its probably something I'm missing (hopefully obvious to all of you. right now it has a left side and a right side drive to 4 can jags (which works just fine). My woes are with this relay. I have named the relay "light" as if it were actuating a light, which in this case all I've been doing is watching the state light on the spike itself. here is the code. Quote:
The gamepad we are using is the logitech rumble F510 if that matters. |
Re: Spike relay mapped to gamepad trouble.
Ok, so it's doing what I want today - didn't change a thing, maybe the c-Rio needed to sleep? Very strange.
While the digital side car registers forward and reverse, the spike will only go forward (green light) can't get it to go into reverse. still some trouble shooting to be done. while frustrating, it has been a fun process (so far).. |
Re: Spike relay mapped to gamepad trouble.
Quote:
B button (2) turns on red light on sidecar, and spike just sits there (not nice) no button, spike is orange - no lights on sidecar. the logic seamed sound, and the sidecar behaves how I expected, but the pesky spike - the reason I'm still drinking coffee in the afternoon. |
Re: Spike relay mapped to gamepad trouble.
Looks like the spike is faulty.
|
Re: Spike relay mapped to gamepad trouble.
Quote:
http://www.chiefdelphi.com/forums/sh...d.php?t=101964 and maybe you would want to try the setDirection method |
| All times are GMT -5. The time now is 10:04. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi