Component: Hall Effect Analog (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.1 (Release)
Category Sensors


Image Hall Effect Analog component

Simple analogue hall effect triggered by the proximity of another object.

Examples

No additional examples


Downloadable macro reference

ReadProximityByte

Get the current proximity reading as a digital value from 0 to 255.

The 'Polarity' property will affect whether the signal increases or decreases as the proximity increases.

Parameters

This macro has no parameters


Return value

BYTE


ReadProximityFloat

Get the current proximity as an analogue value from 0.0 to 1.0.

The 'Polarity' property will affect whether the signal increases or decreases as the proximity increases.

Parameters

This macro has no parameters


Return value

FLOAT


ReadProximityInt

Get the current proximity as a digital value, 10 bit or 12 bit based on your ADC capabilities.

The 'Polarity' property will affect whether the signal increases or decreases as the proximity increases.

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

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!!

Parameters

HANDLE Target
The object to test for collision with.


Return value

This call does not return a value



Property reference

Analog Pin

This property is of type Single analog pin and can be referenced with the variable name AnPin.

No additional information


Polarity

This property is of type Fixed list of ints and can be referenced with the variable name polarity.

The 'Polarity' property will affect whether the signal increases of decreases as the proximity increases.

Rising - Increases signal as proximity increases

Falling - Decreases signal as proximity increases

VRef voltage

This property is of type Signed integer and can be referenced with the variable name adc_base1::vrefvol.

Used by the GetVoltage or GetString component macros to take an ADC reading and convert it into a Voltage.

+VRef voltage x 10mV

Default 500 = 5.0V

VRef option

This property is of type Fixed list of ints and can be referenced with the variable name adc_base1::vrefop.

Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage

VDD - Defines the microcontrollers power supply pin as the max reference,

VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.

Conversion speed

This property is of type Fixed list of ints and can be referenced with the variable name adc_base1::convspd.

Clock setting to select how fast the ADC peripheral will perform an ADC conversion.

The FRC setting is based on a RC time base and so will vary with temperature and pressure.

Other settings are generally based on divisions of the master clock.

Acquisition cycles

This property is of type Signed integer and can be referenced with the variable name adc_base1::actime.

Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.

Magnet Object

This property is of type Panel object and can be referenced with the variable name target.

Select an object from the panel to act as the magnet that triggers the reed switch.

Range

This property is of type Floating point and can be referenced with the variable name range.

Distance within which the sensor begins to be activated.

NB) This is measured between the centre of the proximity sensor and the centre of the target object.

Timer Interval (ms)

This property is of type Unsigned integer and can be referenced with the variable name timer_int.

Time in milliseconds between testing for proximity.

Small time = Greater CPU load

Large time = More like to miss activation if it is very brief.

Scope Traces

This property is of type True or false and can be referenced with the variable name adc_base1::ScopeTraces.

Selects if the scope traces are automatically generated or not