Αεριολογία#
Εισαγωγή#
The VEX IQ Brain can control the VEX IQ Pneumatic system using the pneumatics class. This class allows the Brain to control the pneumatic pump and extend or retract pneumatic cylinders.
Κατασκευαστές κλάσεων#
pneumatics(
int32_t index );
Καταστροφέας κλάσης#
Destroys the pneumatics object and releases associated resources.
~pneumatics();
Παράμετροι#
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The Smart Port that the Pneumatic Solenoid is connected to, written as |
Παράδειγμα#
// Create the pneumatics instance on Port 1
pneumatics Pneumatic1 = pneumatics(PORT1);
Συναρτήσεις Μελών#
The pneumatics 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 pneumatics member functions, a pneumatics instance must be created, as shown below:
/* This constructor is required to use an
IQ Pneumatics Solenoid. Replace the values
as needed. */
// Create the pneumatics instance on Port 1
pneumatics Pneumatic1 = pneumatics(PORT1);
extend#
Επεκτείνει έναν πνευματικό κύλινδρο.
Available Functionsvoid extend(
cylinderType id );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The cylinder to extend:
|
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Extend cylinder 1
Pneumatic1.extend(cylinder1);
// Extend all cylinders
Pneumatic1.extend(cylinderAll);
retract#
Ανασύρει έναν πνευματικό κύλινδρο.
Available Functionsvoid retract(
cylinderType id );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The cylinder to retract:
|
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Retract cylinder 2
Pneumatic1.retract(cylinder2);
// Retract all cylinders
Pneumatic1.retract(cylinderAll);
pump_on#
Ενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump_on();
Αυτή η συνάρτηση δεν έχει παραμέτρους.
Return ValuesΑυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pneumatic pump on
Pneumatic1.pump_on();
pump_off#
Απενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump_off();
Αυτή η συνάρτηση δεν έχει παραμέτρους.
Return ValuesΑυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pneumatic pump off
Pneumatic1.pump_off();
pump#
Ενεργοποιεί ή απενεργοποιεί την πνευματική αντλία.
Available Functionsvoid pump(
bool state );
Παράμετρος |
Τύπος |
Περιγραφή |
|---|---|---|
|
|
The state to set: |
Αυτή η συνάρτηση δεν επιστρέφει τιμή.
Examples// Turn the pump on
Pneumatic1.pump(true);
// Turn the pump off
Pneumatic1.pump(false);
installed#
Επιστρέφει εάν η πνευματική ηλεκτρομαγνητική βαλβίδα είναι συνδεδεμένη με τον εγκέφαλο.
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 (Pneumatic1.installed()) {
// Pneumatic system is ready
Pneumatic1.pump_on();
}