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

index

int32_t

De slimme poort waarop de pneumatische solenoïde is aangesloten, wordt weergegeven als PORTx, waarbij x het poortnummer is (bijvoorbeeld PORT1).

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.

  • pumpOn — Turns the pneumatic pump on.

  • pumpOff — Turns the pneumatic pump off.

  • 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 Functions
void extend( 
  cylinderType id );

Parameters

Parameter

Type

Beschrijving

id

cylinderType

De cilinder die verlengd moet worden:

  • cylinder1
  • cylinder2
  • cylinderAll – Beide cilinders

Return Values

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 Functions
void retract( 
  cylinderType id );

Parameters

Parameter

Type

Beschrijving

id

cylinderType

De cilinder die moet worden ingetrokken:

  • cylinder1
  • cylinder2
  • cylinderAll – Beide cilinders

Return Values

Deze functie retourneert geen waarde.

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

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

pumpOn#

Schakelt de pneumatische pomp in.

Available Functions
void pumpOn();

Parameters

Deze functie heeft geen parameters.

Return Values

Deze functie retourneert geen waarde.

Examples
// Turn the pneumatic pump on
Pneumatic1.pumpOn();

pumpOff#

Schakelt de pneumatische pomp uit.

Available Functions
void pumpOff();

Parameters

Deze functie heeft geen parameters.

Return Values

Deze functie retourneert geen waarde.

Examples
// Turn the pneumatic pump off
Pneumatic1.pumpOff();

pump#

Hiermee wordt de pneumatische pomp in- of uitgeschakeld.

Available Functions
void pump( 
  bool state );

Parameters

Parameter

Type

Beschrijving

state

bool

De in te stellen status: true schakelt de pneumatische pomp in. false schakelt de pneumatische pomp uit.

Return Values

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 Functions
bool installed();

Parameters

Deze functie heeft geen parameters.

Return Values

Geeft een Booleaanse waarde terug die aangeeft of de solenoïde al dan niet met de Brain is verbonden.

  • true als de solenoïde is verbonden met de hersenen.

  • false als de solenoïde niet is aangesloten op de hersenen.

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