mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	tidy up mcp3008 init
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|     "name"          : "node-red-node-pi-mcp3008", | ||||
|     "version"       : "0.5.1", | ||||
|     "version"       : "0.5.2", | ||||
|     "description"   : "A Node-RED node to read from the MCP3008 Analogue to Digital Converter", | ||||
|     "dependencies"  : { | ||||
|         "mcp-spi-adc": "^3.2.0" | ||||
|   | ||||
| @@ -25,12 +25,12 @@ module.exports = function(RED) { | ||||
|         RED.nodes.createNode(this,n); | ||||
|         this.pin = n.pin || 0; | ||||
|         this.interval = n.interval || 1000; | ||||
|         this.dnum = parseInt(n.dnum || 0); | ||||
|         this.bus = parseInt(n.bus || 0); | ||||
|         this.dnum = parseInt(n.dnum) || 0; | ||||
|         this.bus = parseInt(n.bus) || 0; | ||||
|         this.dev = n.dev || "3008"; | ||||
|         this.mcp3xxx = []; | ||||
|         this.cb = function (err) { if (err) { node.error("Error: "+err); } }; | ||||
|         this.opt = { speedHz:20000, deviceNumber:node.dnum, busNumber:node.bus }; | ||||
|         this.opt = { speedHz:20000, deviceNumber:this.dnum, busNumber:this.bus }; | ||||
|         var chans = parseInt(this.dev.substr(3)); | ||||
|         var node = this; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user