Jump to content

Component: Formula Flowcode (Robotics): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(5 intermediate revisions by the same user not shown)
Line 87: Line 87:


===CheckIR===
===CheckIR===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR'''
| width="90%" class="mtx-class-macrohead" | '''CheckIR'''
|-
|-
| colspan="2" | Checks to see if a IR sensor is within the master threshold distance. 
| colspan="2" | Checks to see if a IR sensor is within the master threshold distance. 
Line 106: Line 106:


===Forward===
===Forward===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward'''
| width="90%" class="mtx-class-macrohead" | '''Forward'''
|-
|-
| colspan="2" | Drives both motors of the formula flowcode forwards with the power specified. 
| colspan="2" | Drives both motors of the formula flowcode forwards with the power specified. 
Line 125: Line 125:


===Initialise===
===Initialise===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Starts up the formula flowcode PWM for motor control and performs the wait for button press 
| colspan="2" | Starts up the formula flowcode PWM for motor control and performs the wait for button press 
Line 139: Line 139:


===LEDOff===
===LEDOff===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOff'''
| width="90%" class="mtx-class-macrohead" | '''LEDOff'''
|-
|-
| colspan="2" | Switches off a single LED on the front of the Formula Flowcode. 
| colspan="2" | Switches off a single LED on the front of the Formula Flowcode. 
Line 158: Line 158:


===LEDOn===
===LEDOn===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LEDOn'''
| width="90%" class="mtx-class-macrohead" | '''LEDOn'''
|-
|-
| colspan="2" | Switches on a single LED on the front of the Formula Flowcode. 
| colspan="2" | Switches on a single LED on the front of the Formula Flowcode. 
Line 177: Line 177:


===PlayNote===
===PlayNote===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayNote'''
| width="90%" class="mtx-class-macrohead" | '''PlayNote'''
|-
|-
| colspan="2" | Outputs a single tone from the onboard speaker for the period specified 
| colspan="2" | Outputs a single tone from the onboard speaker for the period specified 
Line 201: Line 201:


===ReadIRSensor===
===ReadIRSensor===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor'''
| width="90%" class="mtx-class-macrohead" | '''ReadIRSensor'''
|-
|-
| colspan="2" | Reads the analogue value from the specified IR distance sensor. 
| colspan="2" | Reads the analogue value from the specified IR distance sensor. 
Line 220: Line 220:


===ReadLDR===
===ReadLDR===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR'''
| width="90%" class="mtx-class-macrohead" | '''ReadLDR'''
|-
|-
| colspan="2" | Reads the current audio signal level from the on-board light sensor. 
| colspan="2" | Reads the current audio signal level from the on-board light sensor. 
Line 234: Line 234:


===ReadLineSensor===
===ReadLineSensor===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor'''
| width="90%" class="mtx-class-macrohead" | '''ReadLineSensor'''
|-
|-
| colspan="2" | Returns the digital value from the line sensor specified. 
| colspan="2" | Returns the digital value from the line sensor specified. 
Line 253: Line 253:


===ReadMic===
===ReadMic===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadMic'''
| width="90%" class="mtx-class-macrohead" | '''ReadMic'''
|-
|-
| colspan="2" | Reads the current audio signal level from the on-board microphone. 
| colspan="2" | Reads the current audio signal level from the on-board microphone. 
Line 267: Line 267:


===ReadSwitch===
===ReadSwitch===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadSwitch'''
| width="90%" class="mtx-class-macrohead" | '''ReadSwitch'''
|-
|-
| colspan="2" | Reads the value of one of the switches from the front of the Formula Flowcode. 
| colspan="2" | Reads the value of one of the switches from the front of the Formula Flowcode. 
Line 286: Line 286:


===Reverse===
===Reverse===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse'''
| width="90%" class="mtx-class-macrohead" | '''Reverse'''
|-
|-
| colspan="2" | Drives both motors of the formula flowcode backwards with the power specified. 
| colspan="2" | Drives both motors of the formula flowcode backwards with the power specified. 
Line 305: Line 305:


===SetMotors===
===SetMotors===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
| width="90%" class="mtx-class-macrohead" | '''SetMotors'''
|-
|-
| colspan="2" | Sets the speed and direction of the Formula Flowcode motors. 
| colspan="2" | Sets the speed and direction of the Formula Flowcode motors. 
Line 329: Line 329:


===SpinLeft===
===SpinLeft===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinLeft'''
| width="90%" class="mtx-class-macrohead" | '''SpinLeft'''
|-
|-
| colspan="2" | Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. 
| colspan="2" | Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. 
Line 348: Line 348:


===SpinRight===
===SpinRight===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight'''
| width="90%" class="mtx-class-macrohead" | '''SpinRight'''
|-
|-
| colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above. 
| colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above. 
Line 367: Line 367:


===Stop===
===Stop===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
| width="90%" class="mtx-class-macrohead" | '''Stop'''
|-
|-
| colspan="2" | Stops both motors 
| colspan="2" | Stops both motors 
Line 381: Line 381:


===WaitForSwitch===
===WaitForSwitch===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch'''
| width="90%" class="mtx-class-macrohead" | '''WaitForSwitch'''
|-
|-
| colspan="2" | Waits for the specified switch to be pressed. 
| colspan="2" | Waits for the specified switch to be pressed. 
Line 400: Line 400:


===WriteLEDs===
===WriteLEDs===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteLEDs'''
| width="90%" class="mtx-class-macrohead" | '''WriteLEDs'''
|-
|-
| colspan="2" | Allows control of all 8-LEDs on the front of the Formula Flowcode. 
| colspan="2" | Allows control of all 8-LEDs on the front of the Formula Flowcode. 
Line 420: Line 420:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 441: Line 441:
| colspan="2" | Motor balance, way of modifying the relative speeds of the motors to allow mismatched motors to work together better. 
| colspan="2" | Motor balance, way of modifying the relative speeds of the motors to allow mismatched motors to work together better. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IR Thresholds (CheckIR macro)
| width="90%" class="mtx-class-propfolder" | IR Thresholds (CheckIR macro)
|-
|-
|-
|-
Line 460: Line 460:
| colspan="2" | IR Threshold used with the CheckIR macro 
| colspan="2" | IR Threshold used with the CheckIR macro 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Parameters
| width="90%" class="mtx-class-propfolder" | Simulation Parameters
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix Ltd
Version 2.0
Category Robotics


Formula Flowcode component

A component to allow all the features of the Formula Flowcode robot to be investigated. Fully simulated component which can interact with simulated objects on the panel as well as control the real hardware.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_FormulaFlowcode.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_FormulaFlowcode.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Importing from v5

The Formula Flowcode component in Flowcode v6 has a new Initialise macro which will need to be added to your program before any other calls to the component are made.


Line Following

Line following example using the Formula Flowcode, works with objects on the simulation panel and on the real hardware. FF-Line


Maze Solving

Wall following example using the Formula Flowcode, works with a randomly generated maze on the simulation panel and on the real hardware. FF-Maze






Macro reference

CheckIR

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


Forward

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


Initialise

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


LEDOff

LEDOff
Switches off a single LED on the front of the Formula Flowcode. 
- BYTE LED
 
- VOID Return


LEDOn

LEDOn
Switches on a single LED on the front of the Formula Flowcode. 
- BYTE LED
 
- VOID Return


PlayNote

PlayNote
Outputs a single tone from the onboard speaker for the period specified 
- BYTE Note
 
- UINT Delay_ms
 
- VOID Return


ReadIRSensor

ReadIRSensor
Reads the analogue value from the specified IR distance sensor. 
- BYTE Sensor
 
- UINT Return


ReadLDR

ReadLDR
Reads the current audio signal level from the on-board light sensor. 
- INT Return


ReadLineSensor

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


ReadMic

ReadMic
Reads the current audio signal level from the on-board microphone. 
- INT Return


ReadSwitch

ReadSwitch
Reads the value of one of the switches from the front of the Formula Flowcode. 
- BYTE Switch
 
- BYTE Return


Reverse

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


SetMotors

SetMotors
Sets the speed and direction of the Formula Flowcode motors. 
- INT Left_Power
Valid Range = -255 to 255 
- INT Right_Power
Valid Range = -255 to 255 
- VOID Return


SpinLeft

SpinLeft
Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. 
- BYTE Power
 
- VOID Return


SpinRight

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


Stop

Stop
Stops both motors 
- VOID Return


WaitForSwitch

WaitForSwitch
Waits for the specified switch to be pressed. 
- BYTE Switch
 
- VOID Return


WriteLEDs

WriteLEDs
Allows control of all 8-LEDs on the front of the Formula Flowcode. 
- BYTE LED_Byte
 
- VOID Return


Property reference

Properties
Wait For Button
Determines if the program will automatically wait for one of the front switches to be pressed before executing the program.  
IR Sensitivity
InfraRed read mode - 8-bit or 10-bit 
Motor Balance (-100 - 100)
Motor balance, way of modifying the relative speeds of the motors to allow mismatched motors to work together better. 
IR Thresholds (CheckIR macro)
Left
IR Threshold used with the CheckIR macro 
Front
IR Threshold used with the CheckIR macro 
Right
IR Threshold used with the CheckIR macro 
Simulation Parameters
Sim Speed (1 - 100)
Sets the simulated amount of movement relative to the speed of the formula flowcode 
Smooth Animation
Selects if the simulation has additional smoothing going on in between iterations 
Manual Redraw
Sets if the animation forces it's own redraws or waits for the system to perform a redraw 
Timer Interval (ms)
Interval in ms between each iteration of the formula flowcode simulated movement 
IR Sensor Iterations
Number of times to repeat the IR sensor tests and therefore how far the simulated IR sensors can sense.  
IR Sensor Resolution
The amount of distance to travel for each iteration of the IR sensor 
Collision Method
Sets whether the sensors on the formula flowcode interact with everything on the panel or just a specific group.