 			wire.writeByte CMD.mode, 1, -> # Switch to output
 
 	ranger: ( port, callback ) ->
-		send CMD.ranger, [port,0,0], ->
+		send CMD.ranger, port, [0,0], ->
 			receive port, 3, (data) ->
 				callback data[2] + data[1]
 




	send = ( cmd, args... ) ->
		writeArgs = [cmd]
		if args[1]
			data = args[0]
			callback = args[1]
			writeArgs.push data
			writeCmd = 'writeBytes'
		else
			callback = args[0]
			writeCmd = 'writeByte'

		console.log arguments

		writeArgs.push (error) ->
			callback()


		readArgs.push (error, data) ->
			callback data
			debug.log "Receive", port, data
			debug.log "ERROR:", error if error

		wire[readCmd] readArgs...

	write: ( type, port, data, callback ) ->
		send CMD[type].write, port, data, callback

	read: ( type, args... ) ->
		send CMD[type].read, args...
