Αεριολογία#

Εισαγωγή#

The VEX V5 Brain can control the CTE Pneumatic system using the pneumatic class. This class allows the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.

Note: CTE Pneumatic commands require the CTE module. Import it using using namespace cte;.

Κατασκευαστές κλάσεων#

pneumatic( 
  int32_t index );

Καταστροφέας κλάσης#

Destroys the pneumatic object and releases associated resources.

~pneumatic();

Παράμετροι#

Παράμετρος

Τύπος

Περιγραφή

index

int32_t

Η Έξυπνη Θύρα στην οποία είναι συνδεδεμένη η Πνευματική Ηλεκτρομαγνητική Βαλβίδα CTE (π.χ., PORT1).

Σημειώσεις#

  • Οι εντολές CTE Pneumatic θα λειτουργούν μόνο με τα εξαρτήματα CTE Pneumatic.

  • You must manually import the CTE module: using namespace cte;.

  • Το σύστημα μπορεί να ελέγχει έως και 4 κυλίνδρους μεμονωμένα ή όλους ταυτόχρονα.

Παράδειγμα#

using namespace cte;

// Create a CTE Pneumatic Solenoid in Port 1
pneumatic ctePneumatic1 = pneumatic(PORT1);

// Turn on the pump and extend cylinder 1
ctePneumatic1.pump_on();
ctePneumatic1.extend(cylinder1);

Συναρτήσεις Μελών#

The pneumatic class includes the following member functions:

  • extend — Extend a cylinder.

  • retract — Retract a cylinder.

  • pump_on — Turns the pneumatic pump on.

  • pump_off — Turns the pneumatic pump off.

  • pump — Turns the pneumatic pump on or off.

  • installed — Returns whether or not the solenoid is connected to the brain.

Before calling any pneumatic member functions, a pneumatic instance must be created, as shown below:

using namespace cte;

/* This constructor is required to use a
CTE Pneumatic Solenoid. Replace the values
as needed. */

// Create the pneumatic instance on Port 1
pneumatic ctePneumatics1 = pneumatic(PORT1);

extend#

Επεκτείνει έναν πνευματικό κύλινδρο.

Available Functions
void extend( 
  cylinderType id );

Parameters

Παράμετρος

Τύπος

Περιγραφή

id

cylinderType

The cylinder to extend:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Extend cylinder 1
ctePneumatic1.extend(cylinder1);

// Extend all cylinders
ctePneumatic1.extend(cylinderAll);

retract#

Ανασύρει έναν πνευματικό κύλινδρο.

Available Functions
void retract( 
  cylinderType id );

Parameters

Παράμετρος

Τύπος

Περιγραφή

id

cylinderType

The cylinder to retract:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Retract cylinder 2
ctePneumatic1.retract(cylinder2);

// Retract all cylinders
ctePneumatic1.retract(cylinderAll);

pump_on#

Ενεργοποιεί την πνευματική αντλία.

Available Functions
void pump_on();

Parameters

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Turn the pneumatic pump on
ctePneumatic1.pump_on();

pump_off#

Απενεργοποιεί την πνευματική αντλία.

Available Functions
void pump_off();

Parameters

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Turn the pneumatic pump off
ctePneumatic1.pump_off();

pump#

Ενεργοποιεί ή απενεργοποιεί την πνευματική αντλία.

Available Functions
void pump( 
  bool state );

Parameters

Παράμετρος

Τύπος

Περιγραφή

state

bool

The state to set: true turns the pneumatic pump on. false turns the pneumatic pump off.

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Turn the pump on
ctePneumatic1.pump(true);

// Turn the pump off
ctePneumatic1.pump(false);

installed#

Επιστρέφει εάν η πνευματική ηλεκτρομαγνητική βαλβίδα CTE είναι συνδεδεμένη με τον εγκέφαλο.

Available Functions
bool installed();

Parameters

Αυτή η συνάρτηση δεν έχει παραμέτρους.

Return Values

Επιστρέφει μια λογική τιμή που υποδεικνύει εάν το σωληνοειδές είναι συνδεδεμένο στον εγκέφαλο ή όχι.

  • true if the solenoid is connected to the Brain.

  • false if the solenoid is not connected to the Brain.

Examples
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
  // Pneumatic system is ready
  ctePneumatic1.pump_on();
}