Aeroibrithe#

Réamhrá#

Is féidir leis an VEX EXP Brain an córas aeroibrithe CTE a rialú ag baint úsáide as modhanna ón rang Pneumatic Ligeann na modhanna seo don Brain an caidéal aeroibrithe a rialú agus sorcóirí aeroibrithe a shíneadh nó a tharraingt siar.

Maidir leis na samplaí thíos, tabharfar pneumatic_1 ar an tSolenoid Aeroibrithe CTE cumraithe agus úsáidfear é i ngach sampla ina dhiaidh sin ar fud an doiciméid API seo agus tagairt á déanamh do mhodhanna ranga Pneumatic.

Seo thíos liosta de na modhanna uile atá ar fáil:

Gníomhartha – Rialú sorcóirí aeroibrithe agus an caidéal aeroibrithe.

  • extend – Síneann sé sorcóir aeroibrithe.

  • retract – Tarraingíonn sé siar sorcóir aeroibrithe.

  • pump_on – Casann sé an caidéal aeroibrithe air.

  • pump_off – Múchann sé an caidéal aeroibrithe.

Socraitheoirí – Cas an caidéal aeroibrithe air nó as.

  • pump – Casann sé an caidéal aeroibrithe air nó as.

Tógálaithe – Déan an Solenoid Aeroibrithe CTE a thosú agus a chumrú de láimh.

  • Pneumatic – Cruthaigh Solenoid Neomatach CTE.

Gníomhartha#

extend#

extend síneadh sorcóir aeroibrithe.

Usage:
extend(cylinder)

Paraiméadar

Cur síos

cylinder

An sorcóir le síneadh:

  • CYLINDER1
  • CYLINDER2
  • CYLINDER3
  • CYLINDER4
  • CYLINDERALL — Síneann sé na sorcóirí uile

# Extend the first cylinder
pneumatic_1.extend(CYLINDER1)

# Wait 2 seconds
wait(2, SECONDS)

# Retract the first cylinder
pneumatic_1.retract(CYLINDER1)

retract#

retract tarraingíonn siar sorcóir aeroibrithe.

Usage:
retract(cylinder)

Paraiméadar

Cur síos

cylinder

An sorcóir le tarraingt siar:

  • CYLINDER1
  • CYLINDER2
  • CYLINDER3
  • CYLINDER4
  • CYLINDERALL — Tarraingíonn sé siar na sorcóirí uile.

# Extend the first cylinder
pneumatic_1.extend(CYLINDER1)

# Wait 2 seconds
wait(2, SECONDS)

# Retract the first cylinder
pneumatic_1.retract(CYLINDER1)

pump_on#

pump_on Casann an caidéal aeroibrithe air.

Usage:
pump_on()

Paraiméadair

Cur síos

Níl aon pharaiméadair ag an modh seo.

# Turn the pneumatic pump on
pneumatic_1.pump_on()

pump_off#

pump_off an caidéal aeroibrithe.

Usage:
pump_off()

Paraiméadair

Cur síos

Níl aon pharaiméadair ag an modh seo.

# Turn the pneumatic pump off
pneumatic_1.pump_off()

Socraitheoirí#

pump#

Casann pump an caidéal aeroibrithe air nó as.

Usage:
pump(state)

Paraiméadar

Cur síos

state

An staid le socrú: True casann an caidéal aeroibrithe air, agus False múchann an caidéal aeroibrithe.

# Turn the pneumatic pump on
pneumatic_1.pump(True)

# Turn the pneumatic pump off
pneumatic_1.pump(False)

Tógálaithe#

Pneumatic#

Cruthaíonn Pneumatic Córas Neomataic.

Pneumatic(smartport)

Paraiméadar

Cur síos

smartport

An Port Cliste a bhfuil an Solenoid Neomatach ceangailte leis, scríofa mar Ports.PORTx áit a seasann x do uimhir an phoirt.

# Construct a Pneumatic System "pneumatic_1" with the
# Pneumatic class
pneumatic_1 = Pneumatic(Ports.PORT1)