H constructors uint8t lcdaddr addr

  • No School
  • AA 1
  • 2

This preview shows page 1 - 2 out of 2 pages.

#include "LiquidCrystal_I2C_ByVac.h" // CONSTRUCTORS // --------------------------------------------------------------------------- LiquidCrystal_I2C_ByVac::LiquidCrystal_I2C_ByVac( uint8_t lcd_Addr ) { _Addr = lcd_Addr; _polarity = NEGATIVE; } // PUBLIC METHODS // --------------------------------------------------------------------------- // // begin void LiquidCrystal_I2C_ByVac::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { Wire.begin(); LCD::begin ( cols, lines, dotsize ); } // User commands - users can expand this section //---------------------------------------------------------------------------- // Turn the integrated backlight off/on // setBacklight void LiquidCrystal_I2C_ByVac::setBacklight( uint8_t value ) { Wire.beginTransmission(_Addr); Wire.write(0x03); // ByVac command code 0x03 for
Image of page 1

Subscribe to view the full document.

backlight if (value==0) Wire.write(1); else Wire.write((byte)0); // 1 for off since polarity is NEGATIVE Wire.endTransmission(); } // Turn the contrast off/on // setContrast void LiquidCrystal_I2C_ByVac::setContrast( uint8_t value ) { Wire.beginTransmission(_Addr); Wire.write(0x05); // ByVac command code 0x05 for contrast if (value==0) Wire.write((byte)0); else Wire.write(1); Wire.endTransmission(); } // PRIVATE METHODS // --------------------------------------------------------------------------- // // init int LiquidCrystal_I2C_ByVac::init() { int status = 0; // ByVac backpack initialized by onboard firmware // ------------------------------------------------------------------------ status=1; return ( status ); } // low level data pushing commands //---------------------------------------------------------------------------- // // send - write either command or data void LiquidCrystal_I2C_ByVac::send(uint8_t value, uint8_t mode) { Wire.beginTransmission(_Addr); Wire.write(mode+1); // map COMMAND (0) -> ByVac command code 0x01/ DATA (1) -> ByVac command code 0x02 Wire.write(value); Wire.endTransmission(); }
Image of page 2
  • Fall '19
  • #include, #endif, #else, Hitachi

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern