本文整理汇总了C++中LcdPanel::clearScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ LcdPanel::clearScreen方法的具体用法?C++ LcdPanel::clearScreen怎么用?C++ LcdPanel::clearScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LcdPanel
的用法示例。
在下文中一共展示了LcdPanel::clearScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rectTest
void rectTest() {
uint32_t i,start;
Rectangle rc;
prompt("Rectangle test");
for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getYmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
_gl->setForeground(rand());
_gl->fillRectangle(rc);
}
_gl->clearScreen();
for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getYmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
_gl->setForeground(rand());
_gl->drawRectangle(rc);
if(i % 1000 ==0)
_gl->clearScreen();
}
}
示例2: rectTest
void rectTest() {
int i;
Rectangle rc;
prompt("Rectangle test");
for(i=0;i<1500;i++) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getXmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
_gl->setForeground(rand());
_gl->fillRectangle(rc);
}
_gl->clearScreen();
for(i=0;i<10000;i++) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getXmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
_gl->setForeground(rand());
_gl->drawRectangle(rc);
if(i % 1000 ==0)
_gl->clearScreen();
}
}
示例3: ellipseTest
void ellipseTest() {
int16_t i;
Point p;
Size s;
uint32_t start;
prompt("Ellipse test");
_gl->setBackground(0);
for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {
p.X=_gl->getXmax()/4+(rand() % (_gl->getXmax()/2));
p.Y=_gl->getYmax()/4+(rand() % (_gl->getYmax()/2));
if(p.X<_gl->getXmax()/2)
s.Width=rand() % p.X;
else
s.Width=rand() % (_gl->getXmax()-p.X);
if(p.Y<_gl->getYmax()/2)
s.Height=rand() % p.Y;
else
s.Height=rand() % (_gl->getYmax()-p.Y);
_gl->setForeground(rand());
_gl->fillEllipse(p,s);
}
_gl->clearScreen();
for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {
p.X=_gl->getXmax()/4+(rand() % (_gl->getXmax()/2));
p.Y=_gl->getYmax()/4+(rand() % (_gl->getYmax()/2));
if(p.X<_gl->getXmax()/2)
s.Width=rand() % p.X;
else
s.Width=rand() % (_gl->getXmax()-p.X);
if(p.Y<_gl->getYmax()/2)
s.Height=rand() % p.Y;
else
s.Height=rand() % (_gl->getYmax()-p.Y);
if(s.Height>0 && s.Width>0 && p.X+s.Width<_gl->getXmax() && p.Y+s.Height<_gl->getYmax()) {
_gl->setForeground(rand());
_gl->drawEllipse(p,s);
}
if(i % 1000==0)
_gl->clearScreen();
}
}
示例4: prompt
void prompt(const char *prompt) {
_gl->setBackground(ColourNames::BLACK);
_gl->clearScreen();
_gl->setForeground(ColourNames::GHOSTWHITE);
*_gl << Point(0,0) << prompt;
MillisecondTimer::delay(2000);
_gl->clearScreen();
}
示例5: drawCompressedBitmap
void drawCompressedBitmap(uint8_t *pixels,uint32_t size,uint16_t width,uint16_t height,bool useDma,DmaFsmcLcdMemoryCopyFeature<LcdAccessMode>& dma) {
_gl->setBackground(ColourNames::WHITE);
_gl->clearScreen();
LinearBufferInputOutputStream compressedData(pixels,size);
LzgDecompressionStream decompressor(compressedData,size);
if(useDma) {
_gl->drawBitmap(
Rectangle(((_gl->getXmax()+1)-width)/2,
((_gl->getYmax()+1)-height)/2,
width,height),
decompressor,
dma);
}
else {
_gl->drawBitmap(
Rectangle(((_gl->getXmax()+1)-width)/2,
((_gl->getYmax()+1)-height)/2,
width,height),
decompressor);
}
MillisecondTimer::delay(3000);
}
示例6: rectTest
void rectTest() {
Rectangle rc;
uint32_t start;
prompt("Rectangle test");
for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getXmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
if(rc.Width>0 && rc.Height>0) {
_gl->setForeground(rand());
_gl->fillRectangle(rc);
}
}
_gl->clearScreen();
for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {
rc.X=(rand() % _gl->getXmax()/2);
rc.Y=(rand() % _gl->getXmax()/2);
rc.Width=rand() % (_gl->getXmax()-rc.X);
rc.Height=rand() % (_gl->getYmax()-rc.Y);
_gl->setForeground(rand());
_gl->drawRectangle(rc);
}
}
示例7: run
void run() {
// reset is on PE1 and RS (D/CX) is on PD11
GpioE<DefaultDigitalOutputFeature<1> > pe;
GpioD<DefaultFsmcAlternateFunctionFeature<11>> pd;
// set up the FSMC with RS=A16 (PD11). The 60Mhz FSMC bus on the F4 needs
// slower timings.
#if defined(STM32PLUS_F1)
Fsmc8080LcdTiming fsmcTiming(0,2);
#else
Fsmc8080LcdTiming fsmcTiming(2,10);
#endif
_accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);
// declare a panel
_gl=new LcdPanel(*_accessMode);
// apply gamma settings
ILI9481Gamma gamma(0,0xf3,0,0xbc,0x50,0x1f,0,7,0x7f,0x7,0xf,0);
_gl->applyGamma(gamma);
// clear to black while the lights are out
_gl->setBackground(0);
_gl->clearScreen();
// create the backlight on timer4, channel2 (PD13)
DefaultBacklight backlight;
// fade up to 100% in 4ms steps
backlight.fadeTo(100,4);
// create a font
_font=new Font_VOLTER__28GOLDFISH_299;
*_gl << *_font;
for(;;) {
jpegTest();
lzgTest();
basicColoursTest();
textTest();
scrollTest();
ellipseTest();
gradientTest();
rectTest();
lineTest();
clearTest();
sleepTest();
}
}
示例8: run
void run() {
// reset is on PE1 and RS (D/CX) is on PE3
GpioE<DefaultDigitalOutputFeature<1>,
DefaultFsmcAlternateFunctionFeature<3> > pe;
// set up the FSMC timing. these numbers (particularly the data setup time) are dependent on
// both the FSMC bus speed and the panel timing parameters.
Fsmc8080LcdTiming fsmcTiming(2,4);
// set up the FSMC with RS=A19 (PE3)
_accessMode=new LcdAccessMode(fsmcTiming,19,pe[1]);
_gl=new LcdPanel(*_accessMode);
// apply gamma settings
ST7783Gamma gamma(0,0x0107,0,0x0203,0x0402,0,0x0207,0,0x0203,0x0403);
_gl->applyGamma(gamma);
// clear to black while the lights are out
_gl->setBackground(0);
_gl->clearScreen();
// create the backlight on timer4, channel2 (PD13)
DefaultBacklight backlight;
// fade up to 100% in 4ms steps
backlight.fadeTo(100,4);
// Create a font. A wide range of sample fonts are available. See the
// "lib/include/display/graphic/fonts" directory for a full list and
// you can always download and convert your own using the FontConv utility.
_font=new Font_VOLTER__28GOLDFISH_299;
*_gl << *_font;
_gl->setForeground(ColourNames::RED);
_gl->fillRectangle(Rectangle(10,20,30,40));
for(;;) {
jpegTest();
lzgTest();
basicColoursTest();
textTest();
ellipseTest();
gradientTest();
rectTest();
lineTest();
clearTest();
sleepTest();
}
}
示例9: clearTest
void clearTest() {
uint32_t start;
prompt("Clear screen test");
for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {
_gl->setBackground(rand());
_gl->clearScreen();
}
}
示例10: run
void run() {
// reset is on PE1 and RS (D/CX) is on PD11
GpioE<DefaultDigitalOutputFeature<1> > pe;
GpioD<DefaultFsmcAlternateFunctionFeature<11> > pd;
// set up the FSMC timing. these numbers (particularly the data setup time) are dependent on
// both the FSMC bus speed and the panel timing parameters.
Fsmc8080LcdTiming fsmcTiming(0,3);
// set up the FSMC with RS=A16 (PD11)
_accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);
_gl=new LcdPanel(*_accessMode);
// clear to black while the lights are out
_gl->setBackground(0);
_gl->clearScreen();
// create the backlight on timer4, channel2 (PD13)
DefaultBacklight backlight;
// fade up to 100% in 4ms steps
backlight.fadeTo(100,4);
// create a font
_font=new Font_VOLTER__28GOLDFISH_299;
*_gl << *_font;
_gl->setForeground(ColourNames::RED);
_gl->fillRectangle(Rectangle(10,20,5,10));
for(;;) {
jpegTest();
lzgTest();
basicColoursTest();
textTest();
scrollTest();
ellipseTest();
gradientTest();
rectTest();
lineTest();
clearTest();
sleepTest();
}
}
示例11: error
void error(const std::string& str) {
_tft->setBackground(ColourNames::WHITE);
_tft->setForeground(ColourNames::BLACK);
_tft->clearScreen();
LinearBufferInputOutputStream compressedData((uint8_t *)&ErrorPixels,(uint32_t)&ErrorPixelsSize);
_tft->drawJpeg(Rectangle(95,135,50,50),compressedData);
*_tft << Point(2,2) << str.c_str();
errorRestart();
}
示例12: run
void run() {
// declare the access mode
LcdAccessMode accessMode;
// declare a panel
_gl=new LcdPanel(accessMode);
// apply the gamma curve. Note that gammas are panel specific. This curve is appropriate
// to a replacement (non-original) panel obtained from ebay.
uint8_t levels[13]={ 0xe,0,1,1,0,0,0,0,0,0,3,4,0 };
R61523Gamma gamma(levels);
_gl->applyGamma(gamma);
// clear to black while the lights are out
_gl->setBackground(0);
_gl->clearScreen();
// create the backlight using default template parameters
_backlight=new LcdBacklight(accessMode);
// fade up the backlight to 100% using the hardware to do the smooth fade
_backlight->setPercentage(100);
// A wide range of sample fonts are available. See the "lib/include/display/graphic/fonts"
// directory for a full list and you can always download and convert your own using the
// FontConv utility.
*_gl << _font;
for(;;) {
textTest();
lzgTest();
basicColoursTest();
backlightTest();
gradientTest();
rectTest();
lineTest();
ellipseTest();
clearTest();
sleepTest();
}
}
示例13: clearTest
void clearTest() {
int i;
uint32_t start;
prompt("Clear screen test");
for(i=0;i<200;i++) {
_gl->setBackground(rand());
start=MillisecondTimer::millis();
_gl->clearScreen();
stopTimer(" to clear",MillisecondTimer::millis()-start);
}
}
示例14: drawCompressedBitmap
void drawCompressedBitmap(uint8_t *pixels,uint32_t size,uint16_t width,uint16_t height) {
_gl->setBackground(ColourNames::WHITE);
_gl->clearScreen();
LinearBufferInputOutputStream compressedData(pixels,size);
LzgDecompressionStream decompressor(compressedData,size);
_gl->drawBitmap(
Rectangle((_gl->getWidth()-width)/2,
(_gl->getHeight()-height)/2,
width,height),
decompressor);
MillisecondTimer::delay(3000);
}
示例15: sleepTest
void sleepTest() {
prompt("Sleep test");
// go to sleep
*_gl << Point::Origin << "Sleeping now...";
MillisecondTimer::delay(1000);
_gl->sleep();
MillisecondTimer::delay(3000);
// wake up
_gl->wake();
_gl->clearScreen();
*_gl << Point::Origin << "Woken up again...";
MillisecondTimer::delay(3000);
}