Go to Post What I’m trying to say is that you should not necessarily be looking to build the next “cool” thing, unless that’s your team’s goal and you’ve got the resources to finish it by ship date. - Bill Gold [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 24-02-2012, 13:46
tux tux is offline
Registered User
AKA: Lee Harr
FRC #3842 (Shock-a-Bots)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Rochester, NY
Posts: 91
tux is an unknown quantity at this point
More sample code (and a few questions)

I have our team's (python) code here on bitbucket:
https://bitbucket.org/leeharr/first3842/src

Python is working quite well for us, though we are not doing anything very complicated. I may split it out in to separate files eventually, but it's not really a problem as it is.

Questions:

1) I based the code from the simple example. It seems like the while clauses in the run() function are extraneous, since the same thing is done inside of the matching functions for disabled() autonomous() and teleop()

Can I safely remove those statements, or do they provide something that I am not seeing?


2) Servo. I could not get this working at all on Tuesday, but I realized later that I did not have the jumper installed next to the PWM output in the digital sidecar. That was probably my main problem, right?

Also: does SetAngle() take 0.0 - 1.0 (as the manual implies) or is there a Set() that takes 0.0 - 1.0 and SetAngle() is the "method to set the servo angle based on the (currently) fixed minimum and maximum angle values"?


3) Analog Input. Does anyone have any code for this? I want to use a potentiometer to sense one of our actuators. I see the section in the User Guide about average bits and oversample, but I don't understand where exactly I am connecting the wires, and how I am reading the raw bits.

Do I just do:

Code:
ai = wpilib.AnalogInput(CHANNEL)
bits = ai.Get()
The manual is pretty dense there on diagrams and theory,
but a bit sparse on the code details.


4) Licensing. I added license statements that I hope are appropriate to attribute where the base code comes from. For modifications that I have made, can I attribute those to "team 3842" or should I (as sole author) assume copyright to my own name? (I would of course release under a BSD-like free license).
Reply With Quote
 


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 06:26.

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