本文整理汇总了C++中LCD::getBacklight方法的典型用法代码示例。如果您正苦于以下问题:C++ LCD::getBacklight方法的具体用法?C++ LCD::getBacklight怎么用?C++ LCD::getBacklight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LCD
的用法示例。
在下文中一共展示了LCD::getBacklight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sleep
void Clock::sleep()
{
if(!sleepOk) sleep_time = 0; else if(!sleepWasOk) awake();
sleepWasOk = sleepOk;
if(sleepOk && sleep_time >= (uint16_t) conf.sysOffTime * 10)
{
// lcd.off();
/* attachInterrupt(1,wakeupFunction,LOW);
sleep_mode();
detachInterrupt(1);*/
hardware_off();
awake();
wasSleeping = 1;
}
else if(backlightVal == 0 && light_time >= (uint16_t) conf.lcdBacklightTime * 10)
{
backlightVal = lcd.getBacklight();
lcd.backlight(0);
}
if(hardware_flashlightIsOn())
{
if(flashlight_time >= (uint16_t) conf.flashlightOffTime * 10)
{
hardware_flashlight(0);
}
}
else
{
flashlight_time = 0;
}
}
示例2: hardware_lightning_disable
void hardware_lightning_disable()
{
EIMSK &= ~_BV(INT6); // Interrupt disable
shutter_off();
hardware_light_disable();
if(backlightVal > lcd.getBacklight())
lcd.backlight(backlightVal);
}
示例3: hardware_readLight
unsigned int hardware_readLight(uint8_t r)
{
// Need to power off lights //
hardware_flashlight(0);
char backlightVal = lcd.getBacklight();
lcd.backlight(0);
if(backlightVal > 0) _delay_ms(50);
if(r > 2) r = 2;
DDRA &= ~0b00000111; // clear all //
PORTA &= ~0b00000111; // clear all //
setBit(r, DDRA); // Powers Sensor //
clrBit(r, PORTA);
_delay_ms(50);
uint16_t light = hardware_analogRead(0);
clrBit(r, DDRA); // Shuts down Sensor //
if(backlightVal > lcd.getBacklight()) lcd.backlight(backlightVal);
return light;
}
示例4: hardware_readLight
unsigned int hardware_readLight(uint8_t r)
{
// Need to power off lights //
backlightVal = lcd.getBacklight();
lcd.backlight(0);
if(backlightVal > 0)
_delay_ms(50);
hardware_light_enable(r);
_delay_ms(50);
uint16_t light = hardware_analogRead(0);
hardware_light_disable();
if(backlightVal > lcd.getBacklight())
lcd.backlight(backlightVal);
return light;
}
示例5: hardware_lightning_enable
void hardware_lightning_enable()
{
// Need to power off lights //
backlightVal = lcd.getBacklight();
lcd.backlight(0);
if(backlightVal > 0)
_delay_ms(50);
setIn(LIGHT_SENSE_PIN); // set to input
setLow(LIGHT_SENSE_PIN); // no pull-up
uint8_t i = 3;
while(i--)
{
hardware_light_enable(i);
_delay_ms(50);
uint16_t reading = hardware_analogRead(0);
//DEBUG('(');
//DEBUG(reading);
//DEBUG(')');
//DEBUG(':');
//DEBUG(' ');
//DEBUG_NL();
if(reading < 256) break;
}
//DEBUG(i);
//if(getPin(LIGHT_SENSE_PIN)) {
// DEBUG(STR("+"));
//}
//else
//{
// DEBUG(STR("-"));
//}
shutter_half();
EIMSK &= ~_BV(INT6); // Interrupt disable
EICRB |= (1<<ISC61)|(1<<ISC60); // Rising edge
EIMSK |= _BV(INT6); // Interrupt enable
}