Pneumatiek#
Invoering#
De VEX IQ Brain kan het VEX IQ Pneumatic-systeem aansturen met behulp van de klasse pneumatics Deze klasse stelt de Brain in staat de pneumatische pomp te besturen en de pneumatische cilinders uit te schuiven of in te trekken.
Klasseconstructors#
pneumatics(
int32_t index );
Klasse-destructor#
Vernietigt het object pneumatics en maakt de bijbehorende resources vrij.
~pneumatics();
Parameters#
Parameter |
Type |
Beschrijving |
|---|---|---|
|
|
De slimme poort waarop de pneumatische solenoïde is aangesloten, wordt weergegeven als |
Voorbeeld#
// Create the pneumatics instance on Port 1
pneumatics Pneumatic1 = pneumatics(PORT1);
Lidfuncties#
De klasse pneumatics omvat de volgende ledenfuncties:
extend— Een cilinder verlengen.retract— Trek een cilinder terug.pump_on— Schakelt de pneumatische pomp in.pump_off— Schakelt de pneumatische pomp uit.pump— Schakelt de pneumatische pomp in of uit.installed— Geeft aan of de solenoïde al dan niet met de hersenen is verbonden.
Voordat er lidfuncties van pneumatics worden aangeroepen, moet er een instantie van pneumatics worden aangemaakt, zoals hieronder weergegeven:
/* 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#
Verlengt een pneumatische cilinder.
Available Functionsvoid extend(
cylinderType id );
Parameter |
Type |
Beschrijving |
|---|---|---|
|
|
De cilinder die verlengd moet worden:
|
Deze functie retourneert geen waarde.
Examples// Extend cylinder 1
Pneumatic1.extend(cylinder1);
// Extend all cylinders
Pneumatic1.extend(cylinderAll);
retract#
Trekt een pneumatische cilinder terug.
Available Functionsvoid retract(
cylinderType id );
Parameter |
Type |
Beschrijving |
|---|---|---|
|
|
De cilinder die moet worden ingetrokken:
|
Deze functie retourneert geen waarde.
Examples// Retract cylinder 2
Pneumatic1.retract(cylinder2);
// Retract all cylinders
Pneumatic1.retract(cylinderAll);
pump_on#
Schakelt de pneumatische pomp in.
Available Functionsvoid pump_on();
Deze functie heeft geen parameters.
Return ValuesDeze functie retourneert geen waarde.
Examples// Turn the pneumatic pump on
Pneumatic1.pump_on();
pump_off#
Schakelt de pneumatische pomp uit.
Available Functionsvoid pump_off();
Deze functie heeft geen parameters.
Return ValuesDeze functie retourneert geen waarde.
Examples// Turn the pneumatic pump off
Pneumatic1.pump_off();
pump#
Hiermee wordt de pneumatische pomp in- of uitgeschakeld.
Available Functionsvoid pump(
bool state );
Parameter |
Type |
Beschrijving |
|---|---|---|
|
|
De in te stellen status: |
Deze functie retourneert geen waarde.
Examples// Turn the pump on
Pneumatic1.pump(true);
// Turn the pump off
Pneumatic1.pump(false);
installed#
Geeft aan of de pneumatische solenoïde is aangesloten op de centrale module.
Available Functionsbool installed();
Deze functie heeft geen parameters.
Return ValuesGeeft een Booleaanse waarde terug die aangeeft of de solenoïde al dan niet met de Brain is verbonden.
trueals de solenoïde is verbonden met de hersenen.falseals de solenoïde niet is aangesloten op de hersenen.
// Check if the pneumatic solenoid is connected
if (Pneumatic1.installed()) {
// Pneumatic system is ready
Pneumatic1.pump_on();
}