Go to Post Its a good bug too. :) - spadercool [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-18-2010, 01:45 PM
pschre's Avatar
pschre pschre is offline
Teacher Coach
AKA: James Schreiner
FRC #0806 (Brooklyn Blacksmiths)
Team Role: Coach
 
Join Date: May 2007
Rookie Year: 2002
Location: Brooklyn
Posts: 29
pschre will become famous soon enoughpschre will become famous soon enough
Send a message via AIM to pschre
Problem regarding code and spikes.

I'm not entirely sure if it's a code problem or an electrical problem, but I'm led to believe it's more of a code problem. We're running two flippers off of relays as opposed to the solenoid breakout, and we're trying to program them via button presses. Pressing the trigger powers both flickers, while button 4 powers the third spike which is powering the left flicker, and button 5 powers the second spike which is powering the right flicker.

if (stick1.getTrigger() == true) {
RightFlicker.set(Relay.Value.kForward);
LeftFlicker.set(Relay.Value.kForward);
}
else {
RightFlicker.set(Relay.Value.kReverse);
LeftFlicker.set(Relay.Value.kReverse);
}

if (stick1.getRawButton(4)) {
LeftFlicker.set(Relay.Value.kForward);
}
else {
LeftFlicker.set(Relay.Value.kReverse);
}

if (stick1.getRawButton(5)) {
RightFlicker.set(Relay.Value.kForward);
}
else {
RightFlicker.set(Relay.Value.kReverse);
}

The flickers are initialized correctly, and are both set to reverse in the constructor. As I said, it may be either a programming or an electrical problem, so it may or may not be the code. Can anyone see any potential problems with that code that will make the flickers not work at all?
__________________


"In this life we cannot do great things. We can only do small things with great love." -- Mother Teresa

"You give yourself to us, O Lord, then selfless let us be, to serve each other in Your name, in truth and charity." -- Robert E. Kreutz, You Satisfy the Hungry Heart

"You have the right to work, but for the work's sake only. You have no rights to the fruits of work. Desire for the fruits of work must never be your motive in working. Never give way to laziness, either...Work done with anxiety about results is far inferior to work done without such anxiety, in the calm of self-surrender...They who work selfishly for results are miserable." -- from the Bhagavad Gita, quoted in Educating Esmé
Reply With Quote
  #2   Spotlight this post!  
Unread 02-18-2010, 02:00 PM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,069
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Problem regarding code and spikes.

What happens if you hold down both the trigger AND button 4/5? I bet you would see it move then.

In other words, looks like a logic error (watch those "else"'s)
Reply With Quote
  #3   Spotlight this post!  
Unread 02-18-2010, 02:13 PM
pschre's Avatar
pschre pschre is offline
Teacher Coach
AKA: James Schreiner
FRC #0806 (Brooklyn Blacksmiths)
Team Role: Coach
 
Join Date: May 2007
Rookie Year: 2002
Location: Brooklyn
Posts: 29
pschre will become famous soon enoughpschre will become famous soon enough
Send a message via AIM to pschre
Re: Problem regarding code and spikes.

Quote:
Originally Posted by Jared341 View Post
What happens if you hold down both the trigger AND button 4/5? I bet you would see it move then.

In other words, looks like a logic error (watch those "else"'s)
Nothing happens when the trigger is held and buttons 4 and/or 5 is pressed.As far as lights go, the spikes turn orange and the relay lights on the digital sidecar go green when the button is pressed.
__________________


"In this life we cannot do great things. We can only do small things with great love." -- Mother Teresa

"You give yourself to us, O Lord, then selfless let us be, to serve each other in Your name, in truth and charity." -- Robert E. Kreutz, You Satisfy the Hungry Heart

"You have the right to work, but for the work's sake only. You have no rights to the fruits of work. Desire for the fruits of work must never be your motive in working. Never give way to laziness, either...Work done with anxiety about results is far inferior to work done without such anxiety, in the calm of self-surrender...They who work selfishly for results are miserable." -- from the Bhagavad Gita, quoted in Educating Esmé
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spikes and jaguars in labview. Shadow_Cat NI LabVIEW 0 01-10-2009 08:17 PM
Lights on Spikes and Vics merybar Electrical 4 01-25-2008 09:18 PM
Motors and Victors/Spikes anna~marie Electrical 4 10-01-2004 09:58 PM
spikes and victors VinceT Electrical 2 01-14-2004 01:36 AM
extra victors and spikes allowed? gail OCCRA 12 11-13-2002 02:17 PM


All times are GMT -5. The time now is 07:34 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi