/// <summary> /// Analog thumb joystick /// </summary> /// <param name="HorizontalPin">Analog pin for the horizontal bar</param> /// <param name="VerticalPin">Analog pin for the vertical bar</param> /// <param name="PushPin">Pin for the push button (optionally this class handles the push button)</param> /// <param name="InvertHorizontal">When true, the horizontal value will be inverted</param> /// <param name="InvertVertical">When true, the vertical value will be inverted</param> public ThumbJoystick(IADCPort HorizontalPin, IADCPort VerticalPin, Cpu.Pin PushPin = Cpu.Pin.GPIO_NONE, bool InvertHorizontal = false, bool InvertVertical = false) { // Configures the analog inputs this._Horizontal = HorizontalPin; this._Horizontal.RangeSet(-50, 50); this._Vertical = VerticalPin; this._Vertical.RangeSet(-50, 50); // Invertion will be copied this.InvertHorizontal = InvertHorizontal; this.InvertVertical = InvertVertical; // If needed, configures the digital input if (PushPin != Cpu.Pin.GPIO_NONE) { this._Push = new InputPort(PushPin, false, Port.ResistorMode.PullUp); } }
/// <summary> /// TMP 36GZ Temperature Sensor /// </summary> /// <param name="AnalogPort">The port the sensor is connected to</param> public Tmp36(IADCPort AnalogPort) { this._AnalogPort = AnalogPort; this._AnalogPort.RangeSet(0, 1024); }
/// <summary> /// TMP 36GZ Temperature Sensor /// </summary> /// <param name="AnalogPort">The port the sensor is connected to</param> public Tmp36(Cpu.AnalogChannel AnalogPort) { this._AnalogPort = new IntegratedADC(AnalogPort); this._AnalogPort.RangeSet(0, 1024); }
/// <summary> /// Sharp Long Distance Measuring Sensor /// </summary> /// <param name="InputPort">Port the sensor is connected to</param> public SharpGP2Y0A02YK(IADCPort InputPort) { // Defines the input port which reads 0 to 3300 millivolt this._Input = InputPort; this._Input.RangeSet(0, 1024); }
/// <summary> /// Analog thumb joystick /// </summary> /// <param name="HorizontalPin">Analog pin for the horizontal bar</param> /// <param name="VerticalPin">Analog pin for the vertical bar</param> /// <param name="PushPin">Pin for the push button (optionally this class handles the push button)</param> /// <param name="InvertHorizontal">When true, the horizontal value will be inverted</param> /// <param name="InvertVertical">When true, the vertical value will be inverted</param> public ThumbJoystick(Cpu.AnalogChannel HorizontalPin, Cpu.AnalogChannel VerticalPin, Cpu.Pin PushPin = Cpu.Pin.GPIO_NONE, bool InvertHorizontal = false, bool InvertVertical = false) { // Configures the analog inputs this._Horizontal = new IntegratedADC(HorizontalPin); this._Horizontal.RangeSet(-50, 50); this._Vertical = new IntegratedADC(VerticalPin); this._Vertical.RangeSet(-50, 50); // Invertion will be copied this.InvertHorizontal = InvertHorizontal; this.InvertVertical = InvertVertical; // If needed, configures the digital input if (PushPin != Cpu.Pin.GPIO_NONE) this._Push = new InputPort(PushPin, false, Port.ResistorMode.PullUp); }
/// <summary> /// Sharp Long Distance Measuring Sensor /// </summary> /// <param name="InputPort">Port the sensor is connected to</param> public SharpGP2Y0A02YK(Cpu.AnalogChannel InputPort) { // Defines the input port which reads 0 to 3300 millivolt this._Input = new IntegratedADC(InputPort); this._Input.RangeSet(0, 1024); }