Αεριολογία#
Εισαγωγή#
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();
Παράμετροι#
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
Η Έξυπνη Θύρα στην οποία είναι συνδεδεμένη η Πνευματική Ηλεκτρομαγνητική Βαλβίδα 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 Functionsvoid extend(
cylinderType id );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The cylinder to extend:
|
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Extend cylinder 1
ctePneumatic1.extend(cylinder1);
// Extend all cylinders
ctePneumatic1.extend(cylinderAll);
retract#
Ανασύρει έναν πνευματικό κύλινδρο.
Available Functionsvoid retract(
cylinderType id );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The cylinder to retract:
|
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Retract cylinder 2
ctePneumatic1.retract(cylinder2);
// Retract all cylinders
ctePneumatic1.retract(cylinderAll);
pump_on#
Ενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump_on();
Αυτή η συνάρτηση δεν έχει παραμέτρους.
Return ValuesΑυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pneumatic pump on
ctePneumatic1.pump_on();
pump_off#
Απενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump_off();
Αυτή η συνάρτηση δεν έχει παραμέτρους.
Return ValuesΑυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pneumatic pump off
ctePneumatic1.pump_off();
pump#
Ενεργοποιεί ή απενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump(
bool state );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The state to set: |
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pump on
ctePneumatic1.pump(true);
// Turn the pump off
ctePneumatic1.pump(false);
installed#
Επιστρέφει εάν η πνευματική ηλεκτρομαγνητική βαλβίδα CTE είναι συνδεδεμένη με τον εγκέφαλο.
Available Functionsbool installed();
Αυτή η συνάρτηση δεν έχει παραμέτρους.
Return ValuesΕπιστρέφει μια λογική τιμή που υποδεικνύει εάν το σωληνοειδές είναι συνδεδεμένο στον εγκέφαλο ή όχι.
trueif the solenoid is connected to the Brain.falseif the solenoid is not connected to the Brain.
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
// Pneumatic system is ready
ctePneumatic1.pump_on();
}