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 |
|---|---|
|
An sorcóir le síneadh:
|
# 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 |
|---|---|
|
An sorcóir le tarraingt siar:
|
# 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 |
|---|---|
|
An staid le socrú: |
# 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 |
|---|---|
|
An Port Cliste a bhfuil an Solenoid Neomatach ceangailte leis, scríofa mar |
# Construct a Pneumatic System "pneumatic_1" with the
# Pneumatic class
pneumatic_1 = Pneumatic(Ports.PORT1)