// Path: public-java/iamcontent-core/src/main/java/com/iamcontent/core/math/MutableDouble.java
// public interface MutableDouble {
// 	double getValue();
// 	void setValue(double v);
// 	
// 	/**
// 	 * Returns a proxy MutableDouble that is a two-way calibrated representation of this value.
// 	 */
// 	default MutableDouble calibrated(DoubleConverter calibration) {
// 		return new CalibratedMutableDouble(this, calibration);
// 	}
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoController.java
// public interface ServoController<C> extends AnalogIOController<C> {
// 	MutableDouble speed(C channelId);
// 	MutableDouble acceleration(C channelId);
// }


import com.iamcontent.core.math.MutableDouble;
import com.iamcontent.device.servo.ServoController;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.device.controller.pololu.maestro;


/**
 * Wraps a {@link PololuMaestroServoCard}, presenting it as a {@link ServoController}.
 * @author Greg Elderfield
 */
public class PololuMaestroServoController implements ServoController<Integer> {

	private final PololuMaestroServoCard card;
	
	public static PololuMaestroServoController pololuMaestroServoController(PololuMaestroServoCard card) {
		return new PololuMaestroServoController(card);
	}
	
	public PololuMaestroServoController(PololuMaestroServoCard card) {
		this.card = card;
	}

	@Override
	public MutableDouble value(Integer channelId) {

// Path: public-java/iamcontent-core/src/main/java/com/iamcontent/core/math/MutableDouble.java
// public interface MutableDouble {
// 	double getValue();
// 	void setValue(double v);
// 	
// 	/**
// 	 * Returns a proxy MutableDouble that is a two-way calibrated representation of this value.
// 	 */
// 	default MutableDouble calibrated(DoubleConverter calibration) {
// 		return new CalibratedMutableDouble(this, calibration);
// 	}
// }
// 
// Path: public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoController.java
// public interface ServoController<C> extends AnalogIOController<C> {
// 	MutableDouble speed(C channelId);
// 	MutableDouble acceleration(C channelId);
// }


// Path: public-java/devices/iamcontent-pololu-servo-controllers/src/main/java/com/iamcontent/device/controller/pololu/maestro/PololuMaestroServoController.java
import com.iamcontent.core.math.MutableDouble;
import com.iamcontent.device.servo.ServoController;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.device.controller.pololu.maestro;


/**
 * Wraps a {@link PololuMaestroServoCard}, presenting it as a {@link ServoController}.
 * @author Greg Elderfield
 */
public class PololuMaestroServoController implements ServoController<Integer> {

	private final PololuMaestroServoCard card;
	
	public static PololuMaestroServoController pololuMaestroServoController(PololuMaestroServoCard card) {
		return new PololuMaestroServoController(card);
	}
	
	public PololuMaestroServoController(PololuMaestroServoCard card) {
		this.card = card;
	}

	@Override
	public MutableDouble value(Integer channelId) {

		return new MutableDouble() {
