Skip to content

Powering Non-Motor Unofficial Custom Electronics #1856

Answered by laurensvalk
mwelch64 asked this question in Q&A
Discussion options

You must be logged in to vote

For DC motors, the hub uses a simple detection method to detect that such a device is attached so that you could never accidentally apply the full voltage to something.

So you can wire your cable such that it is recognized as one of the DC Motors. Then you can use the DCMotor class to power the port at the desired PWM percentage and direction.

For example, see how the ID wires in the train motor are connected to GND and VCC (source). If you do the same in your cable, you'll be able to use the M1 and M2 leads as a normal motor output. Use at your own risk 🙂

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mwelch64
Comment options

@laurensvalk
Comment options

Answer selected by mwelch64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants