本文整理汇总了C++中LCD::setPixel方法的典型用法代码示例。如果您正苦于以下问题:C++ LCD::setPixel方法的具体用法?C++ LCD::setPixel怎么用?C++ LCD::setPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LCD
的用法示例。
在下文中一共展示了LCD::setPixel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: motionTrigger
volatile char motionTrigger(char key, char first)
{
uint8_t i;
uint16_t val;
static uint16_t lv[3];
static uint8_t threshold = 2;
if(key == LEFT_KEY)
{
if(threshold > 0) threshold--;
first = 1;
}
if(key == RIGHT_KEY)
{
if(threshold < 4) threshold++;
first = 1;
}
if(first)
{
sleepOk = 0;
clock.tare();
lcd.cls();
menu.setTitle(TEXT("Motion Sensor"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.drawLine(10, 22, 84-10, 22);
lcd.drawLine(11, 21, 11, 23);
lcd.drawLine(84-11, 21, 84-11, 23);
lcd.drawLine(12, 20, 12, 24);
lcd.drawLine(84-12, 20, 84-12, 24);
lcd.drawLine(13, 20, 13, 24);
lcd.drawLine(84-13, 20, 84-13, 24);
lcd.setPixel(42, 21);
lcd.setPixel(42+10, 21);
lcd.setPixel(42-10, 21);
lcd.setPixel(42+20, 21);
lcd.setPixel(42-20, 21);
i = threshold * 10;
lcd.drawLine(42-3-20+i, 16, 42+3-20+i, 16);
lcd.drawLine(42-2-20+i, 17, 42+2-20+i, 17);
lcd.drawLine(42-1-20+i, 18, 42+1-20+i, 18);
lcd.setPixel(42-20+i, 19);
lcd.writeStringTiny(19, 25, TEXT("SENSITIVITY"));
lcd.update();
lcd.backlight(0);
hardware_flashlight(0);
_delay_ms(50);
for(i = 0; i < 3; i++)
{
lv[i] = (uint16_t)hardware_readLight(i);
}
}
uint8_t thres = 4 - threshold + 2;
if((4 - threshold) > 2) thres += ((4 - threshold) - 1) * 2;
for(i = 0; i < 3; i++)
{
val = (uint16_t)hardware_readLight(i);
if(clock.eventMs() > 1000 && val > thres && (val < (lv[i] - thres) || val > (lv[i] + thres)))
{
clock.tare();
shutter_capture();
}
lv[i] = val;
}
if(key == FL_KEY)
{
sleepOk = 1;
lcd.backlight(255);
return FN_CANCEL;
}
return FN_CONTINUE;
}