Go to Post I want an inflatable playing field so 2 people can setup the competition in one hour at every event. I want it to fit in the back of my car. - Ken Leung [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 09-03-2012, 10:38
Team1605 Team1605 is offline
Registered User
FRC #1605
 
Join Date: Feb 2012
Location: toronto
Posts: 30
Team1605 is an unknown quantity at this point
Need serious help with coding!!

How can i program the part of my robot that will tilt the bridge towards me. i want it to go tilt forward then back. i am coding in netbeans (java).
Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2012, 14:12
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Need serious help with coding!!

The answer to your question can be affected by a lot of things:
  • Which of the many different possible bridge tipping mechanisms are you using?
  • Is it controlled by a Spike, or a speed controller? If the latter, Victor or Jaguar?
  • Are you using the IterativeRobot template, or a Command-based one?
  • Do you want it to respond to user input? If so, should it be button-controlled or joystick controlled? Do you want a button to toggle it?
  • Are there any limit switches involved?
I don't want to give you bad advice, so a little more clarity would be helpful.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2012, 17:56
Jmgiacone's Avatar
Jmgiacone Jmgiacone is offline
Registered User
FRC #2115 (NightMares)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Mundelein & Deerfield
Posts: 3
Jmgiacone is an unknown quantity at this point
Re: Need serious help with coding!!

A great tool that really helped me a lot was the getting started guide(here), and the FRC Programming Cookbook(here). These are both chocked full of great resources, examples, and explanations and are a great way to overcome problems.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2012, 21:39
abrightwell abrightwell is offline
Lead Software Engineer
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Charleston, SC
Posts: 20
abrightwell is an unknown quantity at this point
Re: Need serious help with coding!!

Quote:
Originally Posted by Ginto8 View Post
I don't want to give you bad advice, so a little more clarity would be helpful.
+1

Also, do you have code that already exists that you would like for us to take a look over/review for you?
Reply With Quote
  #5   Spotlight this post!  
Unread 19-03-2012, 10:29
Team1605 Team1605 is offline
Registered User
FRC #1605
 
Join Date: Feb 2012
Location: toronto
Posts: 30
Team1605 is an unknown quantity at this point
Re: Need serious help with coding!!

i am using jaguars(speedcontrollers) i have something like ahand with wheels that i want to tilt. i want a button to toggle it one button tilts forward other button makes it goes backwards

and yes i have code i will post it that too
Reply With Quote
  #6   Spotlight this post!  
Unread 19-03-2012, 10:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Need serious help with coding!!

Quote:
Originally Posted by Team1605 View Post
i am using jaguars(speedcontrollers) i have something like ahand with wheels that i want to tilt. i want a button to toggle it one button tilts forward other button makes it goes backwards

and yes i have code i will post it that too
How is the mechanism supposed to know when to stop, in each direction, after you press each toggle button? i.e. are you using limit switches, or a potentiometer, or an encoder, or something else?


Reply With Quote
  #7   Spotlight this post!  
Unread 19-03-2012, 15:31
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Need serious help with coding!!

a basic code would be
Code:
if(joystick.getRawButton(4)
     jaguar.set(1);
else if(joystick.getRawButton(5)
     jaguar.set(-1);
else
     jaguar.set(0);
__________________
Reply With Quote
  #8   Spotlight this post!  
Unread 19-03-2012, 15:41
Sconrad Sconrad is offline
Registered User
AKA: Connor Young
FRC #0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Yorktown
Posts: 40
Sconrad is an unknown quantity at this point
Re: Need serious help with coding!!

Quote:
Originally Posted by kinganu123 View Post
a basic code would be
Code:
if(joystick.getRawButton(4)
     jaguar.set(1);
else if(joystick.getRawButton(5)
     jaguar.set(-1);
else
     jaguar.set(0);
Note: This will not create a toggle effect. If 4 is pressed, the motor will go forward and if 5 is pressed the motor will go in reverse, but it will not continue to go in that direction if you let go of the button. However, this is a good, simple solution to the problem you are facing. One thing to note about how this code will perform, if both buttons are pressed, the jaguar will go forward. One way to fix this is to replace the first line with
Code:
if(joystick.getRawButton(4) && !joystick.getRawButton(5))
It is a little bit longer, but will protect you from accidentally going in the wrong direction should you hit both buttons in the heat of competition. In order to have a true toggle effect, you will probably need a limit switch or potentiometer or other sensor to tell you when you are done going up or done going down. Hope this helps!
Reply With Quote
  #9   Spotlight this post!  
Unread 19-03-2012, 16:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Need serious help with coding!!

Quote:
Originally Posted by Ether View Post
How is the mechanism supposed to know when to stop, in each direction, after you press each toggle button? i.e. are you using limit switches, or a potentiometer, or an encoder, or something else?
In addition to the above, the other issue you will have to deal with is: How are you going to hold the "tilted hand with wheels" in place once it has reached the desired position?


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


All times are GMT -5. The time now is 11:42.

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