Jump to content

Component: Servo Motor (Tower Pro 9g) ()

From Flowcode Help
Revision as of 21:05, 16 November 2021 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Author Matrix Ltd
Version 1.1
Category


Servo Motor (Tower Pro 9g) component

Small size 9g servo motor suitable for control by the 'Servo Controller' component. Use the 'Link to...' property to attach other objects to the rotor for emulating mechanical systems. Send a virtual PWM signal to the servo by selecting it as a target of the 'Servo Controller' component.

Detailed description

No detailed description exists yet for this component

Examples

Please note that the servo motor template and child components require the Servo Controller component to control them.


Controlling a servo with an analogue input

This example reads the value of the analogue potentiometer and uses this to set the position of the servo motor. Servo Example 1 The Servo controller is linked to the standard servo component but this could be linked to any object on the panel.


Creating a multi-axis actuator using servo motors

This example links two servo motors together using panel primitive objects and groups. Servo Example 2 The Servo controller can handle up to 8 motors and is used to control both of the standard servo components on the panel.

Downloadable macro reference

Forward
Drives both motors of the formula flowcode forwards with the power specified. 
- BYTE Power
 
- VOID Return


ReadLineSensor
Returns the digital value from the line sensor specified. 
- BYTE Sensor
 
- BYTE Return


SpinRight
Spins the formula flowcode on the spot in a clockwise direction as seen from above. 
- BYTE Power
 
- VOID Return


CheckIR
Checks to see if a IR sensor is within the master threshold distance. 
- BYTE Sensor
 
- BYTE Return


ReadIRSensor
Reads the analogue value from the specified IR distance sensor. 
- BYTE Sensor
 
- UINT 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 
- VOID Return


Reverse
Drives both motors of the formula flowcode backwards with the power specified. 
- BYTE Power
 
- VOID Return


WaitForSwitch
Waits for the specified switch to be pressed. 
- BYTE Switch
 
- VOID 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. 
- BYTE LED_Byte
 
- VOID Return


Initialise
Starts up the formula flowcode PWM for motor control and performs the wait for button press 
- VOID Return



Property reference

Properties
Link To...
Select a panel object here to connect it 'mechanically' to the servo's actuator. The selected object will now be moved whenever the servo position changes. NB) To move multiple objects, first group the objects, and then select the group. 
Reverse Output
Some manufacturers motors may rotate in different ways to others. Changing this property allows you to flip the direction of the motor. 
Movement Type
 
Connections
Simulations