Διαμόρφωση πλάτους παλμού (PWM)#

Εισαγωγή#

Η Διαμόρφωση Πλάτους Παλμού (PWM) εξάγει ένα χρονικά καθορισμένο σήμα παλμού από μια θύρα 3 καλωδίων, επιτρέποντας στον εγκέφαλο V5 να ελέγχει παλαιότερα ελεγκτές κινητήρα ή σερβοκινητήρες μεταβάλλοντας το πλάτος παλμού (κύκλος λειτουργίας) κάθε 16 χιλιοστά του δευτερολέπτου (ms).

Note: Pwm objects generate a raw RC-style PWM waveform:

  • Η έξοδος 0% παράγει έναν παλμό 1,5 ms.

  • Η έξοδος 100% παράγει έναν παλμό 2,0 ms.

  • Η έξοδος -100% παράγει παλμό 1,0 ms.

This page uses pwm_a as the example PWM output’s name. Replace it with your own configured name as needed.

Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:

  • value – Returns the PWM output’s current value.

  • state – Sets the PWM output’s value.

Constructor – Χειροκίνητη αρχικοποίηση και διαμόρφωση μιας εξόδου PWM.

  • Pwm – Create a PWM output.

αξία#

value returns the PWM output’s value from -100 to 100 as a percent.

Usage:
pwm_a.value()

Παράμετροι

Περιγραφή

Αυτή η μέθοδος δεν έχει παραμέτρους.

κατάσταση#

state sets the state of the PWM output as a percent.

Usage:
pwm_a.state(value)

Παράμετροι

Περιγραφή

value

Η τιμή που θα οριστεί για την έξοδο PWM, από -100 έως 100.

Κατασκευαστής#

Constructors are used to create Pwm objects, which are necessary for configuring a PWM output.

Pwm#

Pwm creates a PWM output.

Usage:
Pwm(port)

Παράμετρος

Περιγραφή

port

The 3-Wire Port that the PWM output is connected to:

  • On the V5 Brainbrain.three_wire_port.x where x is the number of the port.
  • On a 3-Wire Expanderexpander.a where expander is the name of the expander instance.

# Create a PWM output in Port A
pwm_a = Pwm(brain.three_wire_port.a)