പൊട്ടൻഷ്യോമീറ്റർ#

ആമുഖം#

കറങ്ങുന്ന ഷാഫ്റ്റിന്റെ കോണീയ സ്ഥാനം അളക്കുന്ന അനലോഗ് സെൻസറുകളായ പൊട്ടൻഷ്യോമീറ്ററുകളിൽ pot ഉം potV2 ക്ലാസുകൾ ഉപയോഗിക്കുന്നു. ഒരു പൊട്ടൻഷ്യോമീറ്റർ അതിന്റെ സ്ഥാനത്തിന് ആനുപാതികമായ വോൾട്ടേജ് ഔട്ട്പുട്ട് ചെയ്യുന്നു.

പൊട്ടൻഷ്യോമീറ്റർ പതിപ്പിനെ ആശ്രയിച്ച്, അതിന് കണ്ടെത്താൻ കഴിയുന്ന ഭ്രമണത്തിന്റെ അളവ് വ്യത്യാസപ്പെടുന്നു:

  • പൊട്ടൻഷ്യോമീറ്റർ - 250 ഡിഗ്രി വരെ

  • പൊട്ടൻഷ്യോമീറ്റർ V2 - 330 ഡിഗ്രി (തുടർച്ച)

VEX V5 പൊട്ടൻഷ്യോമീറ്റർ V1.

VEX V5 പൊട്ടൻഷ്യോമീറ്റർ V2.

പൊട്ടൻഷ്യോമീറ്റർ

പൊട്ടൻഷ്യോമീറ്റർ V2

പൊട്ടൻഷ്യോമീറ്റർ#

Class Constructors#

pot(
  triport::port &port );

Class Destructor#

pot ഒബ്ജക്റ്റിനെ നശിപ്പിക്കുകയും അനുബന്ധ ഉറവിടങ്ങൾ പുറത്തുവിടുകയും ചെയ്യുന്നു.

~pot();

Parameters#

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

port

triport::port &

പൊട്ടൻഷ്യോമീറ്റർ ബന്ധിപ്പിച്ചിരിക്കുന്ന 3-വയർ പോർട്ടിലേക്ക്, Brain.ThreeWirePort.X അല്ലെങ്കിൽ ExpanderName.Xഎന്ന് എഴുതിയിരിക്കുന്നു, ഇവിടെ X എന്നത് പോർട്ട് അക്ഷരമാണ് (ഉദാഹരണത്തിന്, Brain.ThreeWirePort.A അല്ലെങ്കിൽ Expander1.A).

Example#

// Create a pot instance in Port A
pot PotentiometerA = pot(Brain.ThreeWirePort.A);

പൊട്ടൻഷ്യോമീറ്റർ V2#

Class Constructors#

potV2(
  triport::port &port );

Class Destructor#

potV2 ഒബ്‌ജക്റ്റ് നശിപ്പിക്കുകയും അനുബന്ധ ഉറവിടങ്ങൾ പുറത്തുവിടുകയും ചെയ്യുന്നു.

~potV2();

Parameters#

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

port

triport::port &

പൊട്ടൻഷിയോമീറ്റർ V2 ബന്ധിപ്പിച്ചിരിക്കുന്ന 3-വയർ പോർട്ടിലേക്ക്, Brain.ThreeWirePort.X അല്ലെങ്കിൽ ExpanderName.Xഎന്ന് എഴുതിയിരിക്കുന്നു, ഇവിടെ X എന്നത് പോർട്ട് അക്ഷരമാണ് (ഉദാഹരണത്തിന്, Brain.ThreeWirePort.A അല്ലെങ്കിൽ Expander1.A).

Examples#

// Create a Potentiometer V2 on 3-Wire Port A
potV2 PotentiometerV2A = potV2(Brain.ThreeWirePort.A);

അംഗ പ്രവർത്തനങ്ങൾ#

pot ഉം potV2 ക്ലാസുകളിൽ ഇനിപ്പറയുന്ന അംഗ ഫംഗ്‌ഷനുകൾ ഉൾപ്പെടുന്നു:

  • angle — പൊട്ടൻഷ്യോമീറ്ററിന്റെ കോണീയ സ്ഥാനം ഡിഗ്രികളിലോ ശതമാനത്തിലോ നൽകുന്നു.

ഏതെങ്കിലും pot അല്ലെങ്കിൽ potV2 അംഗ ഫംഗ്ഷനുകൾ വിളിക്കുന്നതിന് മുമ്പ്, താഴെ കാണിച്ചിരിക്കുന്നതുപോലെ ഒരു pot അല്ലെങ്കിൽ potV2 ഉദാഹരണം സൃഷ്ടിക്കണം:

/* This constructor is required when using VS Code.
Potentiometer configuration is generated automatically
in VEXcode using the Device Menu. Replace the values
as needed. */

// Create a potV2 instance in Port A
potV2 PotentiometerV2A = potV2(Brain.ThreeWirePort.A);

angle#

പൊട്ടൻഷ്യോമീറ്ററിന്റെ കോണീയ സ്ഥാനം നൽകുന്നു.

1 — ഈ ഫംഗ്ഷൻ കോണിനെ ഒരു ശതമാനമായി പ്രതിനിധീകരിക്കുന്നു.

int32_t angle (
  percentUnits units = percentUnits::pct );

2 — ഈ ഫംഗ്ഷൻ തിരഞ്ഞെടുത്ത ഭ്രമണ യൂണിറ്റുകളായി കോണിനെ പ്രതിനിധീകരിക്കുന്നു.

double angle(
  rotationUnits units );

Parameters

പാരാമീറ്റർ

ടൈപ്പ് ചെയ്യുക

വിവരണം

units

percentUnits

പൂർണ്ണ ഭ്രമണത്തിന്റെ ശതമാനമായി സ്ഥാനത്തെ പ്രതിനിധീകരിക്കുന്ന യൂണിറ്റ്: percent / pct (സ്ഥിരസ്ഥിതി) — ശതമാനം, 0 മുതൽ 100% വരെ.

units

rotationUnits

കോണിനെ പ്രതിനിധീകരിക്കുന്ന യൂണിറ്റ്:

  • deg / degrees — ഡിഗ്രി, ഒരു പൊട്ടൻഷ്യോമീറ്ററിന് 0 മുതൽ 250 വരെ അല്ലെങ്കിൽ ഒരു പൊട്ടൻഷ്യോമീറ്ററിന് 0 മുതൽ 330 വരെ V2
  • turns / rev — പരിക്രമണങ്ങൾ

Return Values

റിട്ടേണുകൾ:

  • percentUnits ഉപയോഗിക്കുമ്പോൾ int32_t.

  • double ഉപയോഗിക്കുമ്പോൾ A rotationUnits.

Examples
// Get the current angle of the Potentiometer V2 in the
// range 0 to 330 degrees.
double angle = PotentiometerV2A.angle(degrees);

// Print the current angle of the Potentiometer to the
// brain screen.
Brain.Screen.print(angle);