Go to Post The flux capacitor should have been allowed under the flowchart as long as it met the single component maximum cost. I did check with Digikey and they no longer carry the line. - Al Skierkiewicz [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 08-04-2010, 02:51
spartango spartango is offline
Registered User
FRC #0192 (GRT)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Palo Alto, CA
Posts: 43
spartango is an unknown quantity at this point
Re: Coding in jython

I'd say that the rationale for python should not be that it is syntatically easier for students to learn, but more that as a dynamically typed and fully interpreted language it allows advanced developers to utilize some neat python features...
Reply With Quote
  #2   Spotlight this post!  
Unread 08-04-2010, 13:17
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Coding in jython

I can't say i don't agree. I did port this year's code to jython:

Code:
from edu.wpi.first.wpilibj import SimpleRobot, Timer
from com.shadowh511.mayor.inputs import Xbox, Switch, DomBoard, GreenAsia
from com.shadowh511.mayor.outputs import Driver, FiringThread

class RobotMain(SimpleRobot):
    """
    This is the main robot class, hopefully the robot is smart enough to load
    it :S
    """
    def __init__ (self):
        """
        Makes the robot class variables
        """
        self.driver = Xbox(1)
        self.gunner = GreenAsia(2)
        self.motors = Driver(1,2,3,4,True)
        self.firing = FiringThread()
        self.switch = Switch(4,4)
        self.DomBoard = DomBoard()
        self.watchDog = SimpleRobot.getWatchdog()

    def robotInit(self):
        self.watchDog.setEnabled(False)
        self.watchDog.kill()

    def autonomous(self):
        robotInit()
        print "Autonomous Starting"
        balls = 2

        while SimpleRobot.isEnabled() and balls > 0:
            if switch.ternaryGet():
                self.motors.stop()
                self.firing.autoFire()
                Timer.delay(3)
                balls -=1
            else:
                self.motors.drive(0.5)

        self.motors.stop()

    def operatorControl(self):
        robotInit()
        print "Starting Teleop"

        while SimpleRobot.isEnabled():
            self.motors.mecanumDrive(driver)

            if self.gunner.getCross():
                self.firing.autoFire()
            elif self.gunner.getSquare():
                self.firing.autoTap()
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
Coding Question ZP8892 Programming 1 18-01-2010 20:04
Pneumatics coding Nguyen Programming 19 14-02-2008 20:47
C coding ExarKun666 General Forum 12 21-12-2007 14:13
Photoswitch coding magical hands Programming 0 17-01-2006 21:20
Coding conventions Anthony Kesich Programming 20 08-01-2004 10:50


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

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