|
|
| (22 intermediate revisions by 2 users not shown) |
| Line 14: |
Line 14: |
| ==Maze Generator component== | | ==Maze Generator component== |
| Creates a simulation only randomised maze out of standard micromouse maze walls and pillars. Compatible with the Formula Flowcode robot. | | Creates a simulation only randomised maze out of standard micromouse maze walls and pillars. Compatible with the Formula Flowcode robot. |
| | |
| | ==Component Source Code== |
| | |
| | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_MazeGenerator.fcfx FC_Comp_Source_MazeGenerator.fcfx] |
| | |
| | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_MazeGenerator.fcfx FC_Comp_Source_MazeGenerator.fcfx] |
|
| |
|
| ==Detailed description== | | ==Detailed description== |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
|
| |
|
| ''No detailed description exists yet for this component'' | | ''No detailed description exists yet for this component'' |
| Line 22: |
Line 50: |
|
| |
|
|
| |
|
| ''<span style="color:red;">No additional examples</span>''
| |
|
| |
|
|
| |
|
| ==Downloadable macro reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GenerateMaze'''
| |
| |-
| |
| | colspan="2" | Clears the current maze and generates a new maze over the top. Automatically called when the size of the maze is altered.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forward'''
| |
| |-
| |
| | colspan="2" | Drives both motors of the formula flowcode forwards with the power specified.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Power
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLineSensor'''
| |
| |-
| |
| | colspan="2" | Returns the digital value from the line sensor specified.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Sensor
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SpinRight'''
| |
| |-
| |
| | colspan="2" | Spins the formula flowcode on the spot in a clockwise direction as seen from above.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Power
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckIR'''
| |
| |-
| |
| | colspan="2" | Checks to see if a IR sensor is within the master threshold distance.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Sensor
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIRSensor'''
| |
| |-
| |
| | colspan="2" | Reads the analogue value from the specified IR distance sensor.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Sensor
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
| |
| |-
| |
| | colspan="2" | Sets the speed and direction of the Formula Flowcode motors.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:]] -
| |
| | width="90%" | Left_Power
| |
| |-
| |
| | colspan="2" | Valid Range = -255 to 255
| |
| |-
| |
| | width="10%" align="center" | [[File:]] -
| |
| | width="90%" | Right_Power
| |
| |-
| |
| | colspan="2" | Valid Range = -255 to 255
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Reverse'''
| |
| |-
| |
| | colspan="2" | Drives both motors of the formula flowcode backwards with the power specified.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Power
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitForSwitch'''
| |
| |-
| |
| | colspan="2" | Waits for the specified switch to be pressed.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | Switch
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| | |
| |-
| | ''<span style="color:red;">No additional examples</span>'' |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| | |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLDR'''
| | |
| |-
| | |
| | colspan="2" | Reads the current audio signal level from the on-board light sensor.
| | |
| |-
| | |
| |-
| | |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
| | |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| | |
| |}
| | |
| | |
| | |
| | |
| | |
|
| |
|
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteLEDs'''
| |
| |-
| |
| | colspan="2" | Allows control of all 8-LEDs on the front of the Formula Flowcode.
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| |
| | width="90%" | LED_Byte
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
| | ==Macro reference== |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===GenerateMaze=== |
| | {| 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" | '''GenerateMaze''' |
| |- | | |- |
| | colspan="2" | Starts up the formula flowcode PWM for motor control and performs the wait for button press | | | colspan="2" | Clears the current maze and generates a new maze over the top. Automatically called when the size of the maze is altered. |
| |- | | |- |
| |- | | |- |
| Line 231: |
Line 103: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
| |
|
| |
|
|
| |
|
| ==Property reference== | | ==Property reference== |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="mtx-class-macrotable wikitable" |
| | |- |
| | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] |
| | | width="90%" class="mtx-class-macrohead" | '''Properties''' |
| | |- |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | | width="90%" class="mtx-class-propfolder" | Generation Settings |
| |- | | |- |
| |- | | |- |
| Line 252: |
Line 126: |
| |- | | |- |
| | colspan="2" | Decides if the maze is contained or if there are openings to allow the robot to escape the maze for obstacle course type simulations. No - Creates two holes in the side walls of the maze to match the longest path possible through the maze Yes - The maze is self contained | | | colspan="2" | Decides if the maze is contained or if there are openings to allow the robot to escape the maze for obstacle course type simulations. No - Creates two holes in the side walls of the maze to match the longest path possible through the maze Yes - The maze is self contained |
| | |- |
| | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
| | | width="90%" | Redraw Maze |
| | |- |
| | | colspan="2" | Allows the random maze to be redrawn |
| | |- |
| | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | | width="90%" class="mtx-class-propfolder" | Dimensions |
| | |- |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] |
| Line 267: |
Line 150: |
| |- | | |- |
| | colspan="2" | The total number of individual cells the maze will have | | | colspan="2" | The total number of individual cells the maze will have |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
| |
| |-
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
| |
| |-
| |
| |} | | |} |