Go to Post They didn’t have to help me. But they did. I have gained so much respect for all the mentors in FIRST from that point on. - Arefin Bari [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 30-11-2016, 20:48
FRC Fanatic's Avatar
FRC Fanatic FRC Fanatic is offline
Registered User
no team
 
Join Date: May 2016
Location: United States
Posts: 7
FRC Fanatic is on a distinguished road
Pneumatics Piston not working in python

Hello, so i'm trying to understand how to program pneumatics in python in the off-season. I've read the Robotpy documentation and the Pacgoat pneumatic documentation on github and i want to make sure that the issue is not code side, because the kFoward is functional but not the kReverse

here is a quick rundown of the pneumatic setup
double solenoid on Vex Manifold is running to 1 piston which we just want to control.

here is the code as follows
Code:
#!/usr/mybin/env python3
import math
import wpilib
from RobotMap import RobotMap
from networktables import NetworkTable
from wpilib.doublesolenoid import DoubleSolenoid
class MyRobot(wpilib.IterativeRobot):    
    def robotInit(self):
        self.xb = wpilib.Joystick(2)
        
        self.Compressor = wpilib.Compressor(0)
        self.Compressor.setClosedLoopControl(True)
        self.enabled = self.Compressor.enabled()
        self.PSV = self.Compressor.getPressureSwitchValue()
        self.DS = wpilib.DoubleSolenoid(1,2)
        self.Compressor.start()
 def teleopPeriodic(self):
        elif(self.xb.getRawButton(2)):
                self.DS.set(DoubleSolenoid.Value.kForward)
       elif(self.xb.getRawButton(4)):
                self.DS.set(DoubleSolenoid.Value.kReverse)
is there any glaring issues? i'm new to pneumatic programming and any assistance would be great, thank you.
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 02:41.

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