പൊട്ടൻഷ്യോമീറ്റർ#
ആമുഖം#
കറങ്ങുന്ന ഷാഫ്റ്റിന്റെ കോണീയ സ്ഥാനം അളക്കുന്ന അനലോഗ് സെൻസറുകളായ പൊട്ടൻഷ്യോമീറ്ററുകളിൽ pot ഉം potV2 ക്ലാസുകൾ ഉപയോഗിക്കുന്നു. ഒരു പൊട്ടൻഷ്യോമീറ്റർ അതിന്റെ സ്ഥാനത്തിന് ആനുപാതികമായ വോൾട്ടേജ് ഔട്ട്പുട്ട് ചെയ്യുന്നു.
പൊട്ടൻഷ്യോമീറ്റർ പതിപ്പിനെ ആശ്രയിച്ച്, അതിന് കണ്ടെത്താൻ കഴിയുന്ന ഭ്രമണത്തിന്റെ അളവ് വ്യത്യാസപ്പെടുന്നു:
പൊട്ടൻഷ്യോമീറ്റർ - 250 ഡിഗ്രി വരെ
പൊട്ടൻഷ്യോമീറ്റർ V2 - 330 ഡിഗ്രി (തുടർച്ച)
|
|
|---|---|
പൊട്ടൻഷ്യോമീറ്റർ |
പൊട്ടൻഷ്യോമീറ്റർ V2 |
പൊട്ടൻഷ്യോമീറ്റർ#
Class Constructors#
pot(
triport::port &port );
Class Destructor#
pot ഒബ്ജക്റ്റിനെ നശിപ്പിക്കുകയും അനുബന്ധ ഉറവിടങ്ങൾ പുറത്തുവിടുകയും ചെയ്യുന്നു.
~pot();
Parameters#
പാരാമീറ്റർ |
ടൈപ്പ് ചെയ്യുക |
വിവരണം |
|---|---|---|
|
|
പൊട്ടൻഷ്യോമീറ്റർ ബന്ധിപ്പിച്ചിരിക്കുന്ന 3-വയർ പോർട്ടിലേക്ക്, |
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#
പാരാമീറ്റർ |
ടൈപ്പ് ചെയ്യുക |
വിവരണം |
|---|---|---|
|
|
പൊട്ടൻഷിയോമീറ്റർ V2 ബന്ധിപ്പിച്ചിരിക്കുന്ന 3-വയർ പോർട്ടിലേക്ക്, |
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 );
Parameters2 — ഈ ഫംഗ്ഷൻ തിരഞ്ഞെടുത്ത ഭ്രമണ യൂണിറ്റുകളായി കോണിനെ പ്രതിനിധീകരിക്കുന്നു.
double angle( rotationUnits units );
പാരാമീറ്റർ |
ടൈപ്പ് ചെയ്യുക |
വിവരണം |
|---|---|---|
|
|
പൂർണ്ണ ഭ്രമണത്തിന്റെ ശതമാനമായി സ്ഥാനത്തെ പ്രതിനിധീകരിക്കുന്ന യൂണിറ്റ്: |
|
|
കോണിനെ പ്രതിനിധീകരിക്കുന്ന യൂണിറ്റ്:
|
റിട്ടേണുകൾ:
percentUnitsഉപയോഗിക്കുമ്പോൾint32_t.doubleഉപയോഗിക്കുമ്പോൾ ArotationUnits.
// 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);

