Component: Formula Flowcode (Robotics)

From Flowcode Help
Jump to navigationJump to search
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. FC6 Icon.png FF-Line FFLine.jpg


Maze Solving

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






Macro reference

CheckIR

Fc9-comp-macro.png CheckIR
Checks to see if a IR sensor is within the master threshold distance. 
Fc9-u8-icon.png - BYTE Sensor
 
Fc9-u8-icon.png - BYTE Return


Forward

Fc9-comp-macro.png Forward
Drives both motors of the formula flowcode forwards with the power specified. 
Fc9-u8-icon.png - BYTE Power
 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Starts up the formula flowcode PWM for motor control and performs the wait for button press 
Fc9-void-icon.png - VOID Return


LEDOff

Fc9-comp-macro.png LEDOff
Switches off a single LED on the front of the Formula Flowcode. 
Fc9-u8-icon.png - BYTE LED
 
Fc9-void-icon.png - VOID Return


LEDOn

Fc9-comp-macro.png LEDOn
Switches on a single LED on the front of the Formula Flowcode. 
Fc9-u8-icon.png - BYTE LED
 
Fc9-void-icon.png - VOID Return


PlayNote

Fc9-comp-macro.png PlayNote
Outputs a single tone from the onboard speaker for the period specified 
Fc9-u8-icon.png - BYTE Note
 
Fc9-u16-icon.png - UINT Delay_ms
 
Fc9-void-icon.png - VOID Return


ReadIRSensor

Fc9-comp-macro.png ReadIRSensor
Reads the analogue value from the specified IR distance sensor. 
Fc9-u8-icon.png - BYTE Sensor
 
Fc9-u16-icon.png - UINT Return


ReadLDR

Fc9-comp-macro.png ReadLDR
Reads the current audio signal level from the on-board light sensor. 
Fc9-s16-icon.png - INT Return


ReadLineSensor

Fc9-comp-macro.png ReadLineSensor
Returns the digital value from the line sensor specified. 
Fc9-u8-icon.png - BYTE Sensor
 
Fc9-u8-icon.png - BYTE Return


ReadMic

Fc9-comp-macro.png ReadMic
Reads the current audio signal level from the on-board microphone. 
Fc9-s16-icon.png - INT Return


ReadSwitch

Fc9-comp-macro.png ReadSwitch
Reads the value of one of the switches from the front of the Formula Flowcode. 
Fc9-u8-icon.png - BYTE Switch
 
Fc9-u8-icon.png - BYTE Return


Reverse

Fc9-comp-macro.png Reverse
Drives both motors of the formula flowcode backwards with the power specified. 
Fc9-u8-icon.png - BYTE Power
 
Fc9-void-icon.png - VOID Return


SetMotors

Fc9-comp-macro.png SetMotors
Sets the speed and direction of the Formula Flowcode motors. 
Fc9-s16-icon.png - INT Left_Power
Valid Range = -255 to 255 
Fc9-s16-icon.png - INT Right_Power
Valid Range = -255 to 255 
Fc9-void-icon.png - VOID Return


SpinLeft

Fc9-comp-macro.png SpinLeft
Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. 
Fc9-u8-icon.png - BYTE Power
 
Fc9-void-icon.png - VOID Return


SpinRight

Fc9-comp-macro.png SpinRight
Spins the formula flowcode on the spot in a clockwise direction as seen from above. 
Fc9-u8-icon.png - BYTE Power
 
Fc9-void-icon.png - VOID Return


Stop

Fc9-comp-macro.png Stop
Stops both motors 
Fc9-void-icon.png - VOID Return


WaitForSwitch

Fc9-comp-macro.png WaitForSwitch
Waits for the specified switch to be pressed. 
Fc9-u8-icon.png - BYTE Switch
 
Fc9-void-icon.png - VOID Return


WriteLEDs

Fc9-comp-macro.png WriteLEDs
Allows control of all 8-LEDs on the front of the Formula Flowcode. 
Fc9-u8-icon.png - BYTE LED_Byte
 
Fc9-void-icon.png - VOID Return


Property reference

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