Component: DC Motor ()
From Flowcode Help
Jump to navigationJump to search
Author | Matrix Ltd. |
Version | 1.2 |
Category |
Contents
DC Motor component
DC Motor that can be driven in one or both directions using digital output pins, PWM or HBRIDGE peripherals.
Detailed description
No detailed description exists yet for this component
Examples
Simple example showing how to drive the motor components and how to create sub assemblies attached to the motor output shafts in the simulation panels.
Motors
Downloadable macro reference
![]() |
Coast |
Turn off power to the motor by setting the pins according to the 'Coast Pattern' property. | |
![]() |
Return |
![]() |
Break |
Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. | |
![]() |
Return |
![]() |
Disable |
Disable the motor output | |
![]() |
Return |
![]() |
Forwards |
Set the motor turning in the forwards direction by setting the pins according to the 'Reverse Pattern' property. | |
![]() |
Duty |
Sets the motor power for PWM or H-Bridge outputs | |
![]() |
Return |
![]() |
Enable |
Enables the motor output | |
![]() |
Return |
![]() |
Reverse |
Set the motor turning in the reverse direction by setting the pins according to the 'Reverse Pattern' property. | |
![]() |
Duty |
Sets the motor power for PWM or H-Bridge outputs | |
![]() |
Return |
![]() |
Forward |
Drives both motors of the formula flowcode forwards with the power specified. | |
![]() |
Power |
![]() |
Return |
![]() |
ReadLineSensor |
Returns the digital value from the line sensor specified. | |
![]() |
Sensor |
![]() |
Return |
![]() |
SpinRight |
Spins the formula flowcode on the spot in a clockwise direction as seen from above. | |
![]() |
Power |
![]() |
Return |
![]() |
CheckIR |
Checks to see if a IR sensor is within the master threshold distance. | |
![]() |
Sensor |
![]() |
Return |
![]() |
ReadIRSensor |
Reads the analogue value from the specified IR distance sensor. | |
![]() |
Sensor |
![]() |
Return |
![]() |
SetMotors |
Sets the speed and direction of the Formula Flowcode motors. | |
[[File:]] - | Left_Power |
Valid Range = -255 to 255 | |
[[File:]] - | Right_Power |
Valid Range = -255 to 255 | |
![]() |
Return |
![]() |
Reverse |
Drives both motors of the formula flowcode backwards with the power specified. | |
![]() |
Power |
![]() |
Return |
![]() |
WaitForSwitch |
Waits for the specified switch to be pressed. | |
![]() |
Switch |
![]() |
Return |
![]() |
ReadLDR |
Reads the current audio signal level from the on-board light sensor. | |
[[File:]] - | Return |
![]() |
WriteLEDs |
Allows control of all 8-LEDs on the front of the Formula Flowcode. | |
![]() |
LED_Byte |
![]() |
Return |
![]() |
Initialise |
Starts up the formula flowcode PWM for motor control and performs the wait for button press | |
![]() |
Return |