public void SetAnalogMode(AnalogMode mode, SensorPort port) { byte [] modes = new byte[SensorManager.NumberOfSensorPorts]; for (int i = 0; i < modes.Length; i++) { modes[i] = (byte)AnalogMode.None; } modes[(int)port] = (byte)mode; DeviceManager.Write(modes); }
public override void readAnalogInput(byte pin, AnalogMode mode) { readRegister(mode.register, pin); }
public static ErrorCode SetAnalogMode(void *handle, AnalogMode mode) { return(driver.c_SparkMax_SetAnalogMode(handle, mode)); }
protected void SetMode(AnalogMode mode) { this.AnalogMode = mode; SensorManager.Instance.SetAnalogMode(mode,port); }
/** * Read the value of an analog pin. * When the data is ready, GPIO.receivedAnalogInputAsAbsValue will be called if the analog mode * is set to ABSOLUTE_VALUE. If mode is set to SUPPLY_RATIO, GPIO.receivedAnalogInputAsSupplyRatio * will be called instead * @param pin Pin to read * @param mode Read mode on the pin * @see Callbacks#receivedAnalogInputAsAbsValue(short) * @see Callbacks#receivedAnalogInputAsSupplyRatio(short) */ public abstract void readAnalogInput(byte pin, AnalogMode mode);
protected void SetMode(AnalogMode mode) { this.AnalogMode = mode; SensorManager.Instance.SetAnalogMode(mode, port); }
public void SetAnalogMode(AnalogMode mode, SensorPort port) { byte [] modes = new byte[SensorManager.NumberOfSensorPorts]; for(int i = 0; i < modes.Length; i++) modes[i] = (byte)AnalogMode.None; modes[(int)port] = (byte)mode; DeviceManager.Write(modes); }