Go to Post As they say... I'd rather be lucky than good any day (especially Saturdays). :) - JVN [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 12-06-2012, 23:20
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 165
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Thumbs down Java Servo Issue

This all seems so simple... but we've been unsuccessful getting a servo working in our Java code. We are using a Hitec HS-475HB servo attached to a PWM port on the digital sidecar. We've tripled checked PWM port number and it is correct. I don't have the code with me but here is basically what we are doing:

1) Created a new subsystem class for the servo

2) In the constructor we instance a Servo class using the PWM port as the argument:

m_myServo = new Servo(2);

3) In a method called MoveMyServo() we call

m_myServo.setAngle(20); // actually we increment the previous value by 20

4) We've tried called setPostion() and set() with no joy but after looking through Servo class all these methods eventually call setPosition() with a value from 0-1.

5) Put print statements and stepped through the debugger to verify that the constructor is being called (without errors) and the MoveMyServo() method gets called each time the button is pressed.

In the Servo class it mentions it is set up for a Hitec HS-322HD... does that matter? Are we missing something here?
Reply With Quote
  #2   Spotlight this post!  
Unread 12-06-2012, 23:51
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Java Servo Issue

Is the power jumper (next to the PWM connector) installed?
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #3   Spotlight this post!  
Unread 13-06-2012, 01:57
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Java Servo Issue

The power jumper seems like it's the most likely error, but you could also try the servo on another pin. One of ours had died (we left a PWM cable hanging off of it and it shorted)
Reply With Quote
  #4   Spotlight this post!  
Unread 13-06-2012, 08:17
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 165
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Java Servo Issue

Quote:
Originally Posted by wireties View Post
Is the power jumper (next to the PWM connector) installed?
That must be it! Will try it out tonight.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-06-2012, 23:09
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 165
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Java Servo Issue

Jumper solved the issue. Thanks guys!
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:48.

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