Пример #1
0
        // When the display powers up, it is configured as follows:
        //
        // 1. Display clear
        // 2. Function set:
        //    DL = 1; 8-bit interface data
        //    N = 0; 1-line display
        //    F = 0; 5x8 dot character font
        // 3. Display on/off control:
        //    D = 0; Display off
        //    C = 0; Cursor off
        //    B = 0; Blinking off
        // 4. Entry mode set:
        //    I/D = 1; Increment by 1
        //    S = 0; No shift
        //
        // Note, however, that resetting the Arduino doesn't reset the LCD, so we
        // can't assume that its in that state when a sketch starts (and the
        // LiquidCrystal ructor is called).

        public I2cCharLcd(TreehopperUSB board, int lcd_Addr, int lcd_cols, int lcd_rows)
        {
            _I2C          = board.I2C;
            _Addr         = lcd_Addr;
            _cols         = lcd_cols;
            _rows         = lcd_rows;
            _backlightval = LCD_NOBACKLIGHT;

            _I2C.Start();
            _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
            begin(_cols, _rows);
        }
        public ColorSensor_ADJDS311(I2c I2CDevice, Pin LedPin) : base(0x74, I2CDevice)
        {
            _I2C = I2CDevice;
            _I2C.Start();

            led = LedPin;
            led.MakeDigitalOutput();

            WriteByteData(CAP_RED, 15);
            WriteByteData(CAP_GREEN, 15);
            WriteByteData(CAP_BLUE, 15);
            WriteByteData(CAP_CLEAR, 15);

            WriteByteData(INT_RED_LO, 0x00);
            WriteByteData(INT_RED_HI, 0x4);
            WriteByteData(INT_GREEN_LO, 0x00);
            WriteByteData(INT_GREEN_HI, 0x5);
            WriteByteData(INT_BLUE_LO, 0x00);
            WriteByteData(INT_BLUE_HI, 0x9);
            WriteByteData(INT_CLEAR_LO, 0x00);
            WriteByteData(INT_CLEAR_HI, 0x2);
        }
        public ColorSensor_ADJDS311(I2c I2CDevice, Pin LedPin)
            : base(0x74, I2CDevice)
        {
            _I2C = I2CDevice;
            _I2C.Start();

            led = LedPin;
            led.MakeDigitalOutput();

            WriteByteData(CAP_RED, 15);
            WriteByteData(CAP_GREEN, 15);
            WriteByteData(CAP_BLUE, 15);
            WriteByteData(CAP_CLEAR, 15);

            WriteByteData(INT_RED_LO, 0x00);
            WriteByteData(INT_RED_HI, 0x4);
            WriteByteData(INT_GREEN_LO, 0x00);
            WriteByteData(INT_GREEN_HI, 0x5);
            WriteByteData(INT_BLUE_LO, 0x00);
            WriteByteData(INT_BLUE_HI, 0x9);
            WriteByteData(INT_CLEAR_LO, 0x00);
            WriteByteData(INT_CLEAR_HI, 0x2);
        }
Пример #4
0
        // When the display powers up, it is configured as follows:
        //
        // 1. Display clear
        // 2. Function set:
        //    DL = 1; 8-bit interface data
        //    N = 0; 1-line display
        //    F = 0; 5x8 dot character font
        // 3. Display on/off control:
        //    D = 0; Display off
        //    C = 0; Cursor off
        //    B = 0; Blinking off
        // 4. Entry mode set:
        //    I/D = 1; Increment by 1
        //    S = 0; No shift
        //
        // Note, however, that resetting the Arduino doesn't reset the LCD, so we
        // can't assume that its in that state when a sketch starts (and the
        // LiquidCrystal ructor is called).
        public I2cCharLcd(TreehopperUSB board, int lcd_Addr,int lcd_cols,int lcd_rows)
        {
            _I2C = board.I2C;
              _Addr = lcd_Addr;
              _cols = lcd_cols;
              _rows = lcd_rows;
              _backlightval = LCD_NOBACKLIGHT;

              _I2C.Start();
              _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
              begin(_cols, _rows);
        }
Пример #5
0
 public SMBusDevice(byte address, I2c I2CModule, int rateKHz = 100)
 {
     this.address = address;
     I2c          = I2CModule;
     I2c.Start(rateKHz);
 }