পটেনশিওমিটার#
ভূমিকা#
pot এবং potV2 ক্লাসগুলো পটেনশিওমিটারের সাথে ব্যবহৃত হয়, যা হলো এক প্রকার অ্যানালগ সেন্সর এবং এটি একটি ঘূর্ণায়মান শ্যাফটের কৌণিক অবস্থান পরিমাপ করে। একটি পটেনশিওমিটার তার অবস্থানের সমানুপাতিক একটি ভোল্টেজ আউটপুট দেয়।
পটেনশিওমিটারের সংস্করণভেদে এর শনাক্তযোগ্য ঘূর্ণনের পরিমাণ ভিন্ন হয়:
পটেনশিওমিটার - ২৫০ ডিগ্রি পর্যন্ত
পটেনশিওমিটার ভি২ - ৩৩০ ডিগ্রি (অবিচ্ছিন্ন)
|
|
|---|---|
পটেনশিওমিটার |
পটেনশিওমিটার V2 |
পটেনশিওমিটার#
Class Constructors#
pot(
triport::port &port );
Class Destructor#
pot অবজেক্টটি ধ্বংস করে এবং সংশ্লিষ্ট রিসোর্সগুলো মুক্ত করে।
~pot();
Parameters#
প্যারামিটার |
প্রকার |
বর্ণনা |
|---|---|---|
|
|
পটেনশিওমিটারটি যে ৩-ওয়্যার পোর্টের সাথে সংযুক্ত থাকে, তা |
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 );
প্যারামিটার |
প্রকার |
বর্ণনা |
|---|---|---|
|
|
পূর্ণ ঘূর্ণনের শতাংশ হিসাবে অবস্থান প্রকাশকারী একক: |
|
|
The unit that represents the angle:
|
ফেরত:
percentUnitsব্যবহার করার সময় একটিint32_t।rotationUnitsব্যবহার করার সময়doubleযুক্ত হয়।
// 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);

