Difference between revisions of "Component: Load Cell (HX711) (Sensors)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
(XML import)
Line 1: Line 1:
 
  
 
{| width="50%"
 
{| width="50%"
Line 23: Line 22:
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==
 +
 +
===<span style="font-weight: normal;"><u><tt>SetScaling</tt></u></span>===
 +
Sets the scaler for the samples to provide a meanningful value.
 +
 +
Default scaler is set to 1.0
 +
 +
'''Parameters'''
 +
 +
:[[Variable Types|FLOAT]] ''Scaler''
 +
::Unity Scale = 1.0
 +
 +
 +
'''Return value'''
 +
 +
:''This call does not return a value''
 +
 +
 +
===<span style="font-weight: normal;"><u><tt>Zero</tt></u></span>===
 +
Zeros the reading at the current sample
 +
 +
'''Parameters'''
 +
 +
:''This macro has no parameters''
 +
 +
 +
'''Return value'''
 +
 +
:''This call does not return a value''
 +
  
 
===<span style="font-weight: normal;"><u><tt>Sample</tt></u></span>===
 
===<span style="font-weight: normal;"><u><tt>Sample</tt></u></span>===
Reads data from the HX711 24 bit ADC
+
Allows the HX711 to be directly read using the specified scaling amount.
 +
 
 +
'''Parameters'''
 +
 
 +
:''This macro has no parameters''
 +
 
 +
 
 +
'''Return value'''
 +
 
 +
:[[Variable Types|LONG]]
 +
 
 +
 
 +
===<span style="font-weight: normal;"><u><tt>SetSampleCount</tt></u></span>===
 +
Specifies the number of samples to perform when taking a reading.
 +
 
 +
The more samples the more filtered the signal will become from high frequency noise.
  
 
'''Parameters'''
 
'''Parameters'''
  
:[[Variable Types|FLOAT]] ''Scale''
+
:[[Variable Types|BYTE]] ''NumSamples''
::Scaling factor for load sensor e.g. 1.0
+
::Default 1. Range 1-20
 +
 
 +
:[[Variable Types|UINT]] ''Delay''
 +
::Time to wait between samples in milliseconds.
 +
 
  
:[[Variable Types|FLOAT]] ''Calibrate''
+
'''Return value'''
::Offset for zero of load sensor
 
  
:[[Variable Types|BYTE]] ''Average_count''
+
:''This call does not return a value''
::Sets the number of samples for averaging purposes
 
  
:[[Variable Types|UINT]] ''Average_loop_delay''
 
::sets the delay between each loop <nowiki/>[byte<nowiki/>]
 
  
:[[Variable Types|BOOL]] ''AutoZero''
+
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
::If true zeros the output based on the current measurement
+
Sets up the I/O ready for communications with the HX711 IC and performs an initial sample to set the channel and gain.
 +
 
 +
Must be called before calling other HX711 component macros.
 +
 
 +
'''Parameters'''
 +
 
 +
:''This macro has no parameters''
  
  
 
'''Return value'''
 
'''Return value'''
  
:[[Variable Types|STRING]]
+
:''This call does not return a value''
  
  
Line 57: Line 106:
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Clock Out</u></span>
+
<span style="font-weight: normal;"><u>Input Channel</u></span>
 +
 
 +
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''InputChannel''.
 +
 
 +
Selects which channel to sample A or B.
 +
 
 +
Gain settings are channel specific.
 +
 
 +
A Gain can be 128x or 64x
 +
 
 +
B Gain is fixed at 32x
 +
 
 +
<span style="font-weight: normal;"><u>Input Gain</u></span>
 +
 
 +
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''InputGain''.
 +
 
 +
Gain settings are channel specific.
 +
 
 +
A Gain can be 128x or 64x
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''ClockOut''.
+
B Gain is fixed at 32x
  
''<span style="color:red;">No additional information</span>''
+
<span style="font-weight: normal;"><u>Data</u></span>
  
 +
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Data''.
  
 +
Data pin - connected to HX711 Data Out pin.
  
<span style="font-weight: normal;"><u>Data In</u></span>
+
<span style="font-weight: normal;"><u>Clock</u></span>
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''DataIn''.
+
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Clock''.
  
''<span style="color:red;">No additional information</span>''
+
Clock pin - connected to HX711 SCK pin.

Revision as of 10:26, 7 September 2018

Author Matrix TSL
Version 1.0 (Release)
Category Sensors


Image Load Cell (HX711) component

The HX711 load cell amplifier is used to get measurable data out from a load cell or strain gauge.

Examples

No additional examples


Downloadable macro reference

SetScaling

Sets the scaler for the samples to provide a meanningful value.

Default scaler is set to 1.0

Parameters

FLOAT Scaler
Unity Scale = 1.0


Return value

This call does not return a value


Zero

Zeros the reading at the current sample

Parameters

This macro has no parameters


Return value

This call does not return a value


Sample

Allows the HX711 to be directly read using the specified scaling amount.

Parameters

This macro has no parameters


Return value

LONG


SetSampleCount

Specifies the number of samples to perform when taking a reading.

The more samples the more filtered the signal will become from high frequency noise.

Parameters

BYTE NumSamples
Default 1. Range 1-20
UINT Delay
Time to wait between samples in milliseconds.


Return value

This call does not return a value


Initialise

Sets up the I/O ready for communications with the HX711 IC and performs an initial sample to set the channel and gain.

Must be called before calling other HX711 component macros.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Input Channel

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

Selects which channel to sample A or B.

Gain settings are channel specific.

A Gain can be 128x or 64x

B Gain is fixed at 32x

Input Gain

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

Gain settings are channel specific.

A Gain can be 128x or 64x

B Gain is fixed at 32x

Data

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

Data pin - connected to HX711 Data Out pin.

Clock

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

Clock pin - connected to HX711 SCK pin.