Βίκτορ Μότορ#
Εισαγωγή#
Ο Ελεγκτής Κινητήρα VEX Victor είναι ένας παλαιότερος ελεγκτής κινητήρα που λαμβάνει ένα σήμα PWM 3 καλωδίων από τον εγκέφαλο για τον έλεγχο κινητήρων συνεχούς ρεύματος VEXpro/EDR που δεν μπορούν να συνδεθούν απευθείας σε έξυπνες θύρες.
This page uses victor_motor as the example Victor Motor Controller name. Replace it with your own configured name as needed.
Παρακάτω είναι μια λίστα με τις διαθέσιμες μεθόδους:
spin– Spins a motor forward or reverse until stopped.stop– Stops a motor immediately.set_velocity– Tells a motor how fast to spin.set_reversed– Sets a motor to have its direction be reversed.
Κατασκευαστής – Χειροκίνητη αρχικοποίηση ενός ελεγκτή κινητήρα Victor.
MotorVictor– Creates a Victor Motor Controller.
γνέθω#
spin rotates a connected motor in a specified direction using the current motor velocity.
Usage:
victor_motor.spin(direction, velocity, units)
Παράμετροι |
Περιγραφή |
|---|---|
|
The direction in which to spin the motor:
|
|
Optional. The velocity to spin with from 0% to 100% when using |
|
Optional. The velocity unit:
|
στάση#
stop stops the connected motor immediately.
Usage:
victor_motor.stop()
Παράμετροι |
Περιγραφή |
|---|---|
Αυτή η μέθοδος δεν έχει παραμέτρους. |
set_velocity#
set_velocity tells a motor how fast to spin. A higher percentage makes the motor spin faster and a lower percentage makes the motor spin slower.
Κάθε έργο ξεκινά με κάθε συνδεδεμένο κινητήρα να περιστρέφεται με ταχύτητα 50% από προεπιλογή.
Usage:
victor_motor.set_velocity(value, units)
Παράμετρος |
Περιγραφή |
|---|---|
|
The velocity to spin with from 0% to 100% when using |
|
Optional. The velocity unit:
|
set_reversed#
set_reversed sets the motor to be reversed so that the FORWARD direction will spin clockwise. This method works the same as setting the reverse parameter to True when constructing a MotorVictor.
Usage:
victor_motor.set_reversed(value)
Παράμετροι |
Περιγραφή |
|---|---|
|
Whether the motor’s direction is reversed:
|
Κατασκευαστές#
Constructors are used to create MotorVictor objects, which are necessary for configuring a Victor Motor Controller.
MotorVictor#
MotorVictor creates a Victor Motor Controller.
Usage:
MotorVictor(port, reverse)
Παράμετρος |
Περιγραφή |
|---|---|
|
The 3-Wire Port that the Controller is connected to:
|
|
Optional. Sets whether the motor’s spin should be reversed.
|
# Create a Victor Motor Controller in Port A
victor_motor = MotorVictor(brain.three_wire_port.a)