Difference between revisions of "Component: Formula AllCode (RB4420) (Robotics)"
From Flowcode Help
Jump to navigationJump to searchLine 48: | Line 48: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
+ | |||
+ | |||
Line 53: | Line 55: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===PlayNote=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 76: | Line 79: | ||
+ | ===LEDOn=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 94: | Line 98: | ||
+ | ===BluetoothTransmit=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 112: | Line 117: | ||
+ | ===LCDPrintString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 145: | Line 151: | ||
+ | ===LogoConfigure=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 168: | Line 175: | ||
+ | ===Stop=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 181: | Line 189: | ||
+ | ===ReadBattery=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 194: | Line 203: | ||
+ | ===LEDOff=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 212: | Line 222: | ||
+ | ===LCDPrintNumber=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 245: | Line 256: | ||
+ | ===LEDWrite=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 263: | Line 275: | ||
+ | ===BluetoothCheckConnection=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 276: | Line 289: | ||
+ | ===ReadMic=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 289: | Line 303: | ||
+ | ===AudioQueueLength=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 302: | Line 317: | ||
+ | ===AudioAddToBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 320: | Line 336: | ||
+ | ===ReadSwitch=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 338: | Line 355: | ||
+ | ===CheckLine=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 356: | Line 374: | ||
+ | ===AudioStreamControl=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 379: | Line 398: | ||
+ | ===SpinLeft=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 397: | Line 417: | ||
+ | ===LogoTurnLeft=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 415: | Line 436: | ||
+ | ===Forward=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 433: | Line 455: | ||
+ | ===LCDWriteByte=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 461: | Line 484: | ||
+ | ===BluetoothReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 474: | Line 498: | ||
+ | ===LCDDrawLine=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 507: | Line 532: | ||
+ | ===BluetoothQueueLength=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 520: | Line 546: | ||
+ | ===BluetoothTransmitString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 538: | Line 565: | ||
+ | ===LCDBacklight=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 556: | Line 584: | ||
+ | ===AudioReadFromBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 569: | Line 598: | ||
+ | ===ReadLineSensor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 587: | Line 617: | ||
+ | ===LogoTurnRight=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 605: | Line 636: | ||
+ | ===SpinRight=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 623: | Line 655: | ||
+ | ===CheckIR=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 641: | Line 674: | ||
+ | ===LCDPlotPixel=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 664: | Line 698: | ||
+ | ===LCDSetBackgroundColour=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 682: | Line 717: | ||
+ | ===ReadIRSensor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 700: | Line 736: | ||
+ | ===SetMotors=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 723: | Line 760: | ||
+ | ===LogoBackwards=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 741: | Line 779: | ||
+ | ===EncoderReset=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 754: | Line 793: | ||
+ | ===Reverse=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 772: | Line 812: | ||
+ | ===WaitForSwitch=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 790: | Line 831: | ||
+ | ===ReadLDR=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 803: | Line 845: | ||
+ | ===LCDDrawRectangle=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 846: | Line 889: | ||
+ | ===EncoderReadCount=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 864: | Line 908: | ||
+ | ===CheckUSB=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 877: | Line 922: | ||
+ | ===LCDSetForegroundColour=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 895: | Line 941: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 908: | Line 955: | ||
+ | ===LogoSetSpeed=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 926: | Line 974: | ||
+ | ===LogoForwards=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 944: | Line 993: | ||
+ | ===LCDClear=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:49, 3 February 2023
Author | Matrix TSL |
Version | 1.3 |
Category | Robotics |
Contents
- 1 Formula AllCode component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 PlayNote
- 5.2 LEDOn
- 5.3 BluetoothTransmit
- 5.4 LCDPrintString
- 5.5 LogoConfigure
- 5.6 Stop
- 5.7 ReadBattery
- 5.8 LEDOff
- 5.9 LCDPrintNumber
- 5.10 LEDWrite
- 5.11 BluetoothCheckConnection
- 5.12 ReadMic
- 5.13 AudioQueueLength
- 5.14 AudioAddToBuffer
- 5.15 ReadSwitch
- 5.16 CheckLine
- 5.17 AudioStreamControl
- 5.18 SpinLeft
- 5.19 LogoTurnLeft
- 5.20 Forward
- 5.21 LCDWriteByte
- 5.22 BluetoothReceive
- 5.23 LCDDrawLine
- 5.24 BluetoothQueueLength
- 5.25 BluetoothTransmitString
- 5.26 LCDBacklight
- 5.27 AudioReadFromBuffer
- 5.28 ReadLineSensor
- 5.29 LogoTurnRight
- 5.30 SpinRight
- 5.31 CheckIR
- 5.32 LCDPlotPixel
- 5.33 LCDSetBackgroundColour
- 5.34 ReadIRSensor
- 5.35 SetMotors
- 5.36 LogoBackwards
- 5.37 EncoderReset
- 5.38 Reverse
- 5.39 WaitForSwitch
- 5.40 ReadLDR
- 5.41 LCDDrawRectangle
- 5.42 EncoderReadCount
- 5.43 CheckUSB
- 5.44 LCDSetForegroundColour
- 5.45 Initialise
- 5.46 LogoSetSpeed
- 5.47 LogoForwards
- 5.48 LCDClear
- 6 Property reference
Formula AllCode component
A component to allow all the features of the Formula AllCode 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_FA_Source_P4.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_FA_Source_P4.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
PlayNote
LEDOn
![]() |
LEDOn |
Switches on a single LED on the front of the Formula Allcode. | |
![]() |
LED |
Which LED to switch on, range 0-7 | |
![]() |
Return |
BluetoothTransmit
![]() |
BluetoothTransmit |
Sends a byte via the Bluetooth data connection. | |
![]() |
Data |
![]() |
Return |
LCDPrintString
LogoConfigure
Stop
![]() |
Stop |
Stops both motors. | |
![]() |
Return |
ReadBattery
LEDOff
![]() |
LEDOff |
Switches off a single LED on the front of the Formula Allcode. | |
![]() |
LED |
Which LED to switch on, range 0-7 | |
![]() |
Return |
LCDPrintNumber
LEDWrite
![]() |
LEDWrite |
Allows control of all 8-LEDs on the front of the Formula Allcode. | |
![]() |
LED_Byte |
8-bit binary value to write to the 8 LEDs | |
![]() |
Return |
BluetoothCheckConnection
![]() |
BluetoothCheckConnection |
Checks the status of the Bluetooth connection. Returns 0 for not paired and 1 for paired. | |
![]() |
Return |
ReadMic
![]() |
ReadMic |
Reads the current audio signal level from the on-board microphone. Return value range: 0 to 4095 | |
![]() |
Return |
AudioQueueLength
![]() |
AudioQueueLength |
Retreives the current length of valid data within the audio queue | |
![]() |
Return |
AudioAddToBuffer
![]() |
AudioAddToBuffer |
Writes a value to the 16-bit audio output buffer. | |
![]() |
Data |
![]() |
Return |
ReadSwitch
![]() |
ReadSwitch |
Reads the value of one of the switches from the front of the Formula Allcode. | |
![]() |
Switch |
Which switch do we want to read 0=Left, 1=Right | |
![]() |
Return |
CheckLine
AudioStreamControl
SpinLeft
![]() |
SpinLeft |
Spins the formula flowcode on the spot in an anticlockwise direction as seen from above. | |
![]() |
Power |
Amount of power to use to drive motor. Range 0-100 | |
![]() |
Return |
LogoTurnLeft
Forward
![]() |
Forward |
Drives both motors of the formula flowcode forwards with the power specified. | |
![]() |
Power |
Amount of power to use to drive motor. Range 0-100 | |
![]() |
Return |
LCDWriteByte
![]() |
LCDWriteByte |
![]() |
Data |
![]() |
X |
![]() |
Y |
![]() |
Return |
BluetoothReceive
![]() |
BluetoothReceive |
Attempt to read a byte from the Bluetooth receive queue. | |
![]() |
Return |
LCDDrawLine
![]() |
LCDDrawLine |
Draws a line on the LCD. | |
![]() |
X1 |
Range 0-127 | |
![]() |
Y1 |
Range 0-31 | |
![]() |
X2 |
Range 0-127 | |
![]() |
Y2 |
Range 0-31 | |
![]() |
Return |
BluetoothQueueLength
![]() |
BluetoothQueueLength |
Reads the length of received Bluetooth data in bytes. | |
![]() |
Return |
BluetoothTransmitString
![]() |
BluetoothTransmitString |
Sends a string via the Bluetooth data connection. | |
![]() |
Data |
![]() |
Return |
LCDBacklight
![]() |
LCDBacklight |
Controls the brighness of the LCD backlight | |
![]() |
Brightness |
Range: 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness | |
![]() |
Return |
AudioReadFromBuffer
![]() |
AudioReadFromBuffer |
Allows the audio buffer to be used for other streaming data such as recording the mic. | |
![]() |
Return |
ReadLineSensor
LogoTurnRight
SpinRight
![]() |
SpinRight |
Spins the formula flowcode on the spot in a clockwise direction as seen from above. | |
![]() |
Power |
Amount of power to use to drive motor. Range 0-100 | |
![]() |
Return |
CheckIR
LCDPlotPixel
![]() |
LCDPlotPixel |
Allows a single pixel on the LCD to be set or cleared. | |
![]() |
X |
Sets the X coordinate - Range 0-127 | |
![]() |
Y |
Sets the Y coordinate - Range 0-31 | |
![]() |
Return |
LCDSetBackgroundColour
![]() |
LCDSetBackgroundColour |
Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. | |
![]() |
Colour |
Range 0-1 : 0=White, 1=Black | |
![]() |
Return |
ReadIRSensor
SetMotors
![]() |
SetMotors |
Sets the speed and direction of the Formula Allcode motors. | |
![]() |
Left |
Valid Range = -100 to 100 | |
![]() |
Right |
Valid Range = -100 to 100 | |
![]() |
Return |
LogoBackwards
EncoderReset
![]() |
EncoderReset |
Resets the encoder counters to 0 | |
![]() |
Return |
Reverse
![]() |
Reverse |
Drives both motors of the formula flowcode backwards with the power specified. | |
![]() |
Power |
Amount of power to use to drive motor. Range 0-100 | |
![]() |
Return |
WaitForSwitch
![]() |
WaitForSwitch |
Waits for the specified switch to be pressed. | |
![]() |
Switch |
Which switch do we want to wait for 0=Left, 1=Right, 2=Either, 3=Both | |
![]() |
Return |
ReadLDR
LCDDrawRectangle
EncoderReadCount
![]() |
EncoderReadCount |
Reads one of the motor encoder counters. Each encoder count is equal to 0.314159 mm. | |
![]() |
Channel |
0 = LeftCount, 1=RightCount | |
![]() |
Return |
CheckUSB
![]() |
CheckUSB |
Checks to see if a USB cable is connected to the robot. Returns 0 for no connection and 1 for an active connection. | |
![]() |
Return |
LCDSetForegroundColour
![]() |
LCDSetForegroundColour |
Sets the pixel colour to drive the LCD. Default colour is 1 where a set pixel is black and the background is white. | |
![]() |
Colour |
Range 0-1 : 0=White, 1=Black | |
![]() |
Return |
Initialise
![]() |
Initialise |
Starts up the Formula Allcode PWM for motor control and performs the wait for button press if enabled. | |
![]() |
Return |
LogoSetSpeed
![]() |
LogoSetSpeed |
Sets the cruise speed for LOGO type macros. Default speed 20%. | |
![]() |
Speed |
Range 1-100, Default 60 | |
![]() |
Return |
LogoForwards
LCDClear
![]() |
LCDClear |
Clears the contents of the graphical LCD. | |
![]() |
Return |