本文整理汇总了C++中LiquidCrystal_I2C::setBacklight方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal_I2C::setBacklight方法的具体用法?C++ LiquidCrystal_I2C::setBacklight怎么用?C++ LiquidCrystal_I2C::setBacklight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiquidCrystal_I2C
的用法示例。
在下文中一共展示了LiquidCrystal_I2C::setBacklight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void setup()
{
// debugging channel
Serial1.begin(57600);
while (!Serial1)
{
delay(100);
}
Serial1.print( "RAM at setup " );
Serial1.println( freeRam() );
// ALRAM
pinMode(ALARM_LED_PIN, OUTPUT);
digitalWrite( ALARM_LED_PIN, LOW );
// must "begin" the button to get proper pin assignment/muxing
b.begin();
// initializing ADC channels. The channels 0...7 are assigned to the
// pins A0...A7. Note that the display and the config.txt files, as well as
// the shield's silk layer use enumeration 1 to 8
ADCs[0] = AdcChannel(A0);
ADCs[1] = AdcChannel(A1);
ADCs[2] = AdcChannel(A2);
ADCs[3] = AdcChannel(A3);
ADCs[4] = AdcChannel(A4);
ADCs[5] = AdcChannel(A5);
ADCs[6] = AdcChannel(A6);
ADCs[7] = AdcChannel(A7);
// initializing actuators. The Id is 0 to 7, a bit number in
// actuator byte of the ADC channel. The mapping to the pin is
// pin = A8 + Id
Actuators[0] = Actuator(0, true);
Actuators[1] = Actuator(1, true);
Actuators[2] = Actuator(2, true);
Actuators[3] = Actuator(3, true);
Actuators[4] = Actuator(4, true);
Actuators[5] = Actuator(5, true);
Actuators[6] = Actuator(6, true);
Actuators[7] = Actuator(7, false); // the last actuator is not connected through ULN2003 but directly
// The Real Time Clock
rtc.begin(); // returns bool, but is never false
Serial1.print( "RAM after rtc.begin " );
Serial1.println( freeRam() );
if(rtc.isrunning())
Serial1.println("RTC is running");
else
{
Serial1.println("RTC is NOT running");
rtc.adjust(DateTime(__DATE__, __TIME__)); // setup the current date and time initially
}
DateTime now = rtc.now();
Serial1.print(now.year(), DEC);
Serial1.print('/');
Serial1.print(now.month(), DEC);
Serial1.print('/');
Serial1.print(now.day(), DEC);
Serial1.print(" (");
Serial1.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial1.print(") ");
Serial1.print(now.hour(), DEC);
Serial1.print(':');
Serial1.print(now.minute(), DEC);
Serial1.print(':');
Serial1.print(now.second(), DEC);
Serial1.println();
// activate LCD module
lcd.begin (16,2); // for 16 x 2 LCD module
lcd.setBacklightPin(3,POSITIVE);
lcd.setBacklight(HIGH);
Serial1.print( "RAM after lcd.begin " );
Serial1.println( freeRam() );
if(!Store.begin())
{
Serial1.println("Error initializing the storage");
digitalWrite( ALARM_LED_PIN, HIGH );
}
Serial1.print( "RAM after Storage.begin " );
Serial1.println( freeRam() );
// the below makes sure the 1st active item is displayed upon start up. Otherwise
// the item 0 is displayed, even if inactive
Store.mIndex = CHANNEL_COUNT-1;
Store.Advance();
//.........这里部分代码省略.........