Component: Beam Breaker (Light)

From Flowcode Help
Revision as of 17:19, 9 November 2022 by Wiki bot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author Matrix Ltd
Version 1.1
Category Light


Beam Breaker component

Automatically sets and resets a pin depending on whether a panel object breaks the 'light beam'. Can also send simulation notification events.

Component Pack

SENSORS

Detailed description

No detailed description exists yet for this component

Examples

Simple example showing the collision detector component at work, when a collision is detected the direction of the motor is reversed. FC6 Icon.png Detector Simple example showing the beam break detector component at work, when a collision is detected the direction of the bouncing ball is reversed. FC6 Icon.png Beam Break Demo

Downloadable macro reference

Fc9-comp-macro.png ReadState
Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTarget
Set the object that you want to test for collision with. If this is not called, or is called with handle = 0, collisions will be tested against every panel object that has 'Solid' status. NB) Specifying an object will save CPU power!! 
Fc9-h32-icon.png - HANDLE Target
The object to test for collision with. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WaitUntilHigh
Pause the program until the detector goes high. 'Polarity' will affect whether high value represents a collision or separation. NB) In simulation, only use this macro if testing for collision with animated or timer driven objects!! 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WaitUntilLow
Pause the program until the detector goes low. 'Polarity' will affect whether low value represents a collision or separation. NB) In simulation, only use this macro if testing for collision with animated or timer driven objects!! 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Pin
Chip pin that the beam breaker is connected to,. 
Fc9-type-16-icon.png Polarity
Active High = Pin is on when beam is broken, off when beam is intact. Active Low = Pin is off when beam is broken, on when beam is intact. 
Fc9-conn-icon.png Simulation
Fc9-type-17-icon.png Target
Choose a specific object to test for breaking the beam. If none is chosen, will check against any other object with 'Solid' status - note, checking all objects increases the CPU load!! 
Fc9-type-15-icon.png Range
Set the distance between the transmitter and receiver 
Fc9-type-7-icon.png Show Beam
Shows the 'light beam' on screen - arrow points from transmitter to receiver. 
Fc9-type-21-icon.png Timer Interval (ms)
Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions. 
Fc9-conn-icon.png Notification
Fc9-type-7-icon.png Notify
Whether or not to notify the component parent of any changes. Data will be zero or one (the current pin value).