mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	Changed comments to match the format used in 145-digital-in.*
This commit is contained in:
		@@ -14,7 +14,7 @@
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<!-- Define the edit dialog -->
 | 
			
		||||
<!-- Edit dialog for analogue-in -->
 | 
			
		||||
<script type="text/x-red" data-template-name="analog-in">
 | 
			
		||||
   <div class="form-row">
 | 
			
		||||
       <label for="node-input-pin"><i class="icon-asterisk"></i>Input pin</label>
 | 
			
		||||
@@ -54,10 +54,11 @@
 | 
			
		||||
    </div>
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<!-- Add help text -->
 | 
			
		||||
<!-- Help text for analogue-in -->
 | 
			
		||||
<script type="text/x-red" data-help-name="analog-in">
 | 
			
		||||
<p>
 | 
			
		||||
Analogue input for the Beaglebone Black. Reads an analogue pin when triggered
 | 
			
		||||
Analogue input for the Beaglebone Black. Reads an analogue pin when triggered by
 | 
			
		||||
a message.
 | 
			
		||||
</p>
 | 
			
		||||
<p>The output message topic is the node topic: the output message value is the
 | 
			
		||||
scaled analogue input or NaN if a read error occurs.
 | 
			
		||||
@@ -74,7 +75,7 @@ voltage ten times in rapid succession for each input message and output the mean
 | 
			
		||||
</p>
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<!-- Register the node -->
 | 
			
		||||
<!-- Register analogue-in node -->
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    RED.nodes.registerType('analog-in', {
 | 
			
		||||
        category: 'advanced-input', // the palette category
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ try {
 | 
			
		||||
    require("util").log("[144-analog-in] Error: cannot find module 'bonescript'");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// The main node definition - most things happen in here
 | 
			
		||||
// Node constructor for analogue-in
 | 
			
		||||
function AnalogInputNode(n) {
 | 
			
		||||
    // Create a RED node
 | 
			
		||||
    RED.nodes.createNode(this, n);
 | 
			
		||||
@@ -40,8 +40,7 @@ function AnalogInputNode(n) {
 | 
			
		||||
    	this.averages = 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Define 'node' to allow us to access 'this' from within callbacks (the 'var' is essential -
 | 
			
		||||
    // otherwise there is only one global 'node' for all instances of AnalogInputNode!)
 | 
			
		||||
    // Define 'node' to allow us to access 'this' from within callbacks
 | 
			
		||||
    var node = this;
 | 
			
		||||
 | 
			
		||||
	// Variables used for input averaging
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user