コード例 #1
0
ファイル: LcdRgb.cs プロジェクト: microestc/dotnet-iot
        /// <summary>
        /// Initializes a new HD44780 LCD with an RGB Backlight.
        /// </summary>
        /// <param name="size">Size of the device in characters. Usually 16x2 or 20x4.</param>
        /// <param name="lcdInterface">Interface to the display.</param>
        /// <param name="rgbDevice">The I2C device to control RGB backlight.</param>
        public LcdRgb(Size size, LcdInterface lcdInterface, I2cDevice rgbDevice)
            : base(size, lcdInterface)
        {
            _rgbDevice = rgbDevice;

            InitRgb();
        }
コード例 #2
0
ファイル: LcdRgb.cs プロジェクト: microestc/dotnet-iot
        /// <summary>
        /// Initializes a new HD44780 LCD controller.
        /// </summary>
        /// <param name="size">Size of the device in characters. Usually 16x2 or 20x4.</param>
        /// <param name="lcdDevice">The I2C device to control LCD display.</param>
        /// <param name="rgbDevice">The I2C device to control RGB backlight.</param>
        public LcdRgb(Size size, I2cDevice lcdDevice, I2cDevice rgbDevice)
            : base(size, LcdInterface.CreateI2c(lcdDevice, true))
        {
            _rgbDevice = rgbDevice;

            InitRgb();
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new HD44780 LCD controller.
        /// </summary>
        /// <param name="size">The logical size of the LCD.</param>
        /// <param name="lcdInterface">The interface to use with the LCD.</param>
        public Hd44780(Size size, LcdInterface lcdInterface)
        {
            Size          = size;
            _lcdInterface = lcdInterface;

            if (_lcdInterface.EightBitMode)
            {
                _displayFunction |= DisplayFunction.EightBit;
            }

            Initialize(size.Height);
            _rowOffsets = InitializeRowOffsets(size.Height);
        }
コード例 #4
0
ファイル: Lcd1602.cs プロジェクト: giegloop/iot-1
 /// <summary>
 /// Constructs a new HD44780 based 16x2 LCD controller with integrated I2c support.
 /// </summary>
 /// <remarks>
 /// This is for on-chip I2c support. For connecting via I2c GPIO expanders, use the GPIO constructor <see cref="Lcd1602(int, int, int[], int, float, int, IGpioController)"/>.
 /// </remarks>
 /// <param name="device">The I2c device for the LCD.</param>
 public Lcd1602(I2cDevice device)
     : base(new Size(16, 2), LcdInterface.CreateI2c(device))
 {
 }
コード例 #5
0
ファイル: Lcd1602.cs プロジェクト: giegloop/iot-1
 /// <summary>
 /// Constructs a new HD44780 based 16x2 LCD controller, using GPIO pins.
 /// </summary>
 /// <param name="registerSelectPin">The pin that controls the regsiter select.</param>
 /// <param name="enablePin">The pin that controls the enable switch.</param>
 /// <param name="dataPins">Collection of pins holding the data that will be printed on the screen.</param>
 /// <param name="backlightPin">The optional pin that controls the backlight of the display.</param>
 /// <param name="backlightBrightness">The brightness of the backlight. 0.0 for off, 1.0 for on.</param>
 /// <param name="readWritePin">The optional pin that controls the read and write switch.</param>
 /// <param name="controller">The controller to use with the LCD. If not specified, uses the platform default.</param>
 public Lcd1602(int registerSelectPin, int enablePin, int[] dataPins, int backlightPin = -1, float backlightBrightness = 1.0f, int readWritePin = -1, IGpioController controller = null)
     : base(new Size(16, 2), LcdInterface.CreateGpio(registerSelectPin, enablePin, dataPins, backlightPin, backlightBrightness, readWritePin, controller))
 {
 }
コード例 #6
0
 /// <summary>
 /// Constructs a new LCD 20x4 controller with the given interface
 /// </summary>
 /// <param name="lcdInterface">The LCD Interface</param>
 public Lcd2004(LcdInterface lcdInterface)
     : base(new Size(20, 4), lcdInterface)
 {
 }
コード例 #7
0
 /// <summary>
 /// Constructs a new HD44780 based 16x2 LCD controller with integrated I2c support.
 /// </summary>
 /// <remarks>
 /// This is for on-chip I2c support. For connecting via I2c GPIO expanders, use the GPIO constructor <see cref="Lcd1602(int, int, int[], int, float, int, GpioController, bool)"/>.
 /// </remarks>
 /// <param name="device">The I2c device for the LCD.</param>
 /// <param name="uses8Bit">True if the device uses 8 Bit commands, false if it handles only 4 bit commands.</param>
 public Lcd2004(I2cDevice device, bool uses8Bit = true)
     : base(new Size(20, 4), LcdInterface.CreateI2c(device, uses8Bit))
 {
 }
コード例 #8
0
 /// <summary>
 /// Constructs a new HD44780 based 20x4 LCD controller.
 /// </summary>
 /// <param name="registerSelectPin">The pin that controls the regsiter select.</param>
 /// <param name="enablePin">The pin that controls the enable switch.</param>
 /// <param name="dataPins">Collection of pins holding the data that will be printed on the screen.</param>
 /// <param name="backlightPin">The optional pin that controls the backlight of the display.</param>
 /// <param name="backlightBrightness">The brightness of the backlight. 0.0 for off, 1.0 for on.</param>
 /// <param name="readWritePin">The optional pin that controls the read and write switch.</param>
 /// <param name="controller">The controller to use with the LCD. If not specified, uses the platform default.</param>
 /// <param name="shouldDispose">True to dispose the Gpio Controller</param>
 public Lcd2004(int registerSelectPin, int enablePin, int[] dataPins, int backlightPin = -1, float backlightBrightness = 1.0f, int readWritePin = -1, GpioController controller = null, bool shouldDispose = true)
     : base(new Size(20, 4), LcdInterface.CreateGpio(registerSelectPin, enablePin, dataPins, backlightPin, backlightBrightness, readWritePin, controller, shouldDispose))
 {
 }
コード例 #9
0
ファイル: Lcd1602.cs プロジェクト: microestc/dotnet-iot
 /// <summary>
 /// Constructs a new 16x2 LCD controller with the given interface
 /// </summary>
 /// <param name="lcdInterface">The LCD Interface</param>
 public Lcd1602(LcdInterface lcdInterface)
     : base(new Size(16, 2), lcdInterface)
 {
 }
コード例 #10
0
ファイル: Lcd1602.cs プロジェクト: microestc/dotnet-iot
 /// <summary>
 /// Constructs a new HD44780 based 16x2 LCD controller with integrated I2c support.
 /// </summary>
 /// <remarks>
 /// This is for on-chip I2c support. For connecting via I2c GPIO expanders, use the GPIO constructor <see cref="Lcd1602(int, int, int[], int, float, int, GpioController, bool)"/>.
 /// </remarks>
 /// <param name="device">The I2c device for the LCD.</param>
 /// <param name="uses8Bit">True if the device uses 8 Bit commands, false if it handles only 4 bit commands.</param>
 public Lcd1602(I2cDevice device, bool uses8Bit = true)
     : base(new Size(16, 2), LcdInterface.CreateI2c(device, uses8Bit))
 {
 }