本文整理汇总了C++中clearDisplay函数的典型用法代码示例。如果您正苦于以下问题:C++ clearDisplay函数的具体用法?C++ clearDisplay怎么用?C++ clearDisplay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clearDisplay函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: hour1
void Clock::displayColor(bool onOff)
{
Digit hour1(x, y), hour2(x, y+10), min1(x, y+25), min2(x, y+35), sec1(x, y+50), sec2(x, y+60);
hour1.changeColor(true);
hour2.changeColor(true);
min1.changeColor(true);
min2.changeColor(true);
sec1.changeColor(true);
sec2.changeColor(true);
if(onOff)
{
clearDisplay();
hour1.display(hr/10, true);
hour2.display(hr%10, true);
min1.display(min/10, true);
min2.display(min%10, true);
sec1.display(sec/10, isSec);
sec2.display(sec%10, isSec);
if(isPM)
{
attron(COLOR_PAIR(BLACKONYELLOW));
mvprintw(x+6, y-5, "PM");
attroff(COLOR_PAIR(BLACKONYELLOW));
}
else
{
attron(COLOR_PAIR(WHITEONBLACK));
mvprintw(x+6, y-5, " ");
}
refresh();
}
else
clearDisplay();
}
开发者ID:Stektograph,项目名称:alarm-clock,代码行数:35,代码来源:clock.cpp
示例2: main
void main() {
unsigned char x, y, xdir, ydir;
unsigned int i;
// === Initialize system ================================================
IFG1=0; /* clear interrupt flag1 */
WDTCTL=WDTPW+WDTHOLD; /* stop WD */
init();
initNokia();
clearDisplay();
x=4; y=4;
ydir=1; xdir=1;
drawBlock(y,x);
while(1) {
if (ydir ==1){
y++;
if(y>=8) ydir=0;
}
if (ydir==0){
y--;
if(y<=0) ydir=1;
}
if (xdir ==1){
x++;
if (x>=11) xdir = 0;
}
if(xdir==0){
x--;
if(x<=0) xdir =1;
}
clearDisplay();
drawBlock(y,x);
for(i=0; i<10; i++){
moveDelay();
}
}
}
开发者ID:apleaf,项目名称:Lab4ECE382,代码行数:54,代码来源:lab4B.c
示例3: MePort
Me7SegmentDisplay::Me7SegmentDisplay(uint8_t port): MePort(port)
{
pinMode(s2, OUTPUT);
pinMode(s1, OUTPUT);
set();
clearDisplay();
}
开发者ID:shao-kai,项目名称:makeblock_new_lib,代码行数:7,代码来源:Me7SegmentDisplay.cpp
示例4: Adafruit_GFX
SharpMemory::SharpMemory(uint8_t chipSelect): Adafruit_GFX(DISPLAY_WIDTH, DISPLAY_HEIGHT) {
// Store the CS Pin
csPin = chipSelect;
// Set the pin low
digitalWrite(csPin, LOW);
// Set the pin as an output
pinMode(csPin, OUTPUT);
// Initialize VCOM state
vcomHigh = false;
// Set the flag for knowing if there are changes that need to be written
hasChanges = false;
for(unsigned int index = 0; index < sizeof(lineHasChanges); index++) {
lineHasChanges[index] = false;
}
// Initialize SPI library
SPI.begin();
// Clear the display after initialization
clearDisplay();
}
开发者ID:deisterhold,项目名称:SharpMemory,代码行数:26,代码来源:SharpMemory.cpp
示例5: delayMicroseconds
void LOOL_OLED::begin() {
_i2caddr = 0x3C;
Wire.begin(); // Is this the right place for this?
delayMicroseconds(50);
ssd1306_command(SSD1306_DISPLAYOFF); // 0xAE
ssd1306_command(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
ssd1306_command(0x80); // the suggested ratio 0x80
ssd1306_command(SSD1306_SETMULTIPLEX); // 0xA8
ssd1306_command(0x3F);
ssd1306_command(SSD1306_SETDISPLAYOFFSET); // 0xD3
ssd1306_command(0x0); // no offset
ssd1306_command(SSD1306_SETSTARTLINE | 0x0); // line #0
ssd1306_command(SSD1306_CHARGEPUMP); // 0x8D
ssd1306_command(0x14);
ssd1306_command(SSD1306_MEMORYMODE); // 0x20
ssd1306_command(0x00); // 0x0 act like ks0108
ssd1306_command(SSD1306_SEGREMAP | 0x1);
ssd1306_command(SSD1306_COMSCANDEC);
ssd1306_command(SSD1306_SETCOMPINS); // 0xDA
ssd1306_command(0x12);
ssd1306_command(SSD1306_SETCONTRAST); // 0x81
ssd1306_command(0xCF);
ssd1306_command(SSD1306_SETPRECHARGE); // 0xd9
ssd1306_command(0xF1);
ssd1306_command(SSD1306_SETVCOMDETECT); // 0xDB
ssd1306_command(0x40);
ssd1306_command(SSD1306_DISPLAYALLON_RESUME); // 0xA4
ssd1306_command(SSD1306_NORMALDISPLAY); // 0xA6
ssd1306_command(SSD1306_DISPLAYON);//--turn on oled panel
clearDisplay();
}
开发者ID:hewei110110,项目名称:loollool,代码行数:32,代码来源:LOOL_OLED.cpp
示例6: PrintMenu
void PrintMenu(char *menu, int select){
clearDisplay();
setAddrPointer( 0x00 , 0x00 );
size_t line=0, chs = 0, i=0;
if(select==line){ PrintChar('>'); }
else{ PrintChar(' '); }
chs++;
while(menu[i]!='\0'){
if(menu[i]=='\n'){
while(chs++<20){
PrintChar(' ');
}
if(++line == select){
PrintChar('>');
}
else{ PrintChar(' '); }
chs = 1;
}
else{
chs++;
PrintChar(menu[i]);
}
i++;
}
PrintEmptyLine();
PrintEmptyLine();
PrintEmptyLine();
PrintEmptyLine();
PrintEmptyLine();
}
开发者ID:Kchymet,项目名称:Digistockey,代码行数:30,代码来源:lcd.c
示例7: initDisplay
/**
* @brief Initialisiert das Display
*
*/
void initDisplay() {
DDRB |= 0xfc;
resetRS();
PORTB |= 0x30;
PORTB &= 0x3f;
_delay_ms(15);
toggleEnable();
_delay_ms(5);
toggleEnable();
_delay_us(200);
toggleEnable();
PORTB |= 0x20;
PORTB &= 0x2f;
toggleEnable();
_delay_ms(3);
writeCommand(0x2C);
writeCommand(0x0E);
clearDisplay();
}
开发者ID:fhdummy,项目名称:antifancontrol,代码行数:29,代码来源:LCD.c
示例8: ENTER
int UVCPreview::stopPreview() {
ENTER();
bool b = isRunning();
if (LIKELY(b)) {
mIsRunning = false;
pthread_cond_signal(&preview_sync);
pthread_cond_signal(&capture_sync);
if (pthread_join(capture_thread, NULL) != EXIT_SUCCESS) {
LOGW("UVCPreview::terminate capture thread: pthread_join failed");
}
if (pthread_join(preview_thread, NULL) != EXIT_SUCCESS) {
LOGW("UVCPreview::terminate preview thread: pthread_join failed");
}
clearDisplay();
}
clearPreviewFrame();
clearCaptureFrame();
pthread_mutex_lock(&preview_mutex);
if (mPreviewWindow) {
ANativeWindow_release(mPreviewWindow);
mPreviewWindow = NULL;
}
pthread_mutex_unlock(&preview_mutex);
pthread_mutex_lock(&capture_mutex);
if (mCaptureWindow) {
ANativeWindow_release(mCaptureWindow);
mCaptureWindow = NULL;
}
pthread_mutex_unlock(&capture_mutex);
RETURN(0, int);
}
开发者ID:ozone999,项目名称:usbcamera,代码行数:31,代码来源:UVCPreview.cpp
示例9: initializeDisplay
void initializeDisplay()
{
pinMode(13, OUTPUT);
pinOutput(13, LOW);
pinMode(R1_PIN,OUTPUT);
pinMode(G1_PIN,OUTPUT);
pinMode(B1_PIN,OUTPUT);
pinMode(R2_PIN,OUTPUT);
pinMode(G2_PIN,OUTPUT);
pinMode(B2_PIN,OUTPUT);
pinMode(CLK_PIN,OUTPUT);
pinMode(OE_PIN,OUTPUT);
pinMode(A_PIN,OUTPUT);
pinMode(B_PIN,OUTPUT);
pinMode(C_PIN,OUTPUT);
pinMode(LAT_PIN,OUTPUT);
pinOutput(A_PIN, 0);
pinOutput(B_PIN, 0);
pinOutput(C_PIN, 0);
pinOutput(LAT_PIN, 0);
pinOutput(OE_PIN, 0);
pinOutput(CLK_PIN, 1);
startTimer(TC1, 0, TC3_IRQn, 1000);
clearDisplay();
}
开发者ID:kimocode,项目名称:CalPolyLEDBoard,代码行数:29,代码来源:display.cpp
示例10: pinMode
LedControl::LedControl(int dataPin, int clkPin, int csPin, int numDevices, bool anode, bool reflect, bool upsidedown) {
SPI_MOSI=dataPin;
SPI_CLK=clkPin;
SPI_CS=csPin;
if(numDevices<=0 || numDevices>8 )
numDevices=8;
maxDevices=numDevices;
anodeMode=anode;
reflectMode=reflect;
upsidedownMode=upsidedown;
pinMode(SPI_MOSI,OUTPUT);
pinMode(SPI_CLK,OUTPUT);
pinMode(SPI_CS,OUTPUT);
digitalWrite(SPI_CS,HIGH);
SPI_MOSI=dataPin;
for(int i=0;i<64;i++) {
status[i]=0x00;
statusTransposed[i]=0x00;
}
for(int i=0;i<maxDevices;i++) {
spiTransfer(i,OP_DISPLAYTEST,0);
//scanlimit is set to max on startup
setScanLimit(i,7);
//decode is done in source
spiTransfer(i,OP_DECODEMODE,0);
clearDisplay(i);
//we go into shutdown-mode on startup
shutdown(i,true);
}
}
开发者ID:beaver999,项目名称:mygoodjob,代码行数:31,代码来源:GearLedControl.cpp
示例11: main
void main(void)
{
unsigned char difficulty = 0;
unsigned char input = 0;
P1_4 = 1;
/* init hardware */
fb_init();
keyboard_init();
EA = 1; // enable global interrupts
/* show our startdisplay */
display_start(difficulty);
while(1) {
input = readBuf();
/* change difficulty which results in changing speed */
if(input == SHIFT_KEY) {
difficulty++;
if(difficulty > 2) {
difficulty = 0;
}
display_start(difficulty);
}
/* start game with space */
if(input == SPACE_KEY) {
clearDisplay();
start_game(15000 - difficulty*5000);
display_start(difficulty);
}
}
}
开发者ID:schuere,项目名称:hnseBoard,代码行数:32,代码来源:main.c
示例12: defined
void GameOfLight::begin() {
#if defined(GameOfLightHW)
Serial.begin(500000); //DEBUG
// Initialize the communication with the display controller
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV8);
pinMode(SCREEN_SS_PIN, OUTPUT);
pinMode(controller[0], INPUT);
pinMode(controller[1], INPUT);
pinMode(controller[2], INPUT);
pinMode(controller[3], INPUT);
pinMode(SNES_CLK_PIN, OUTPUT);
pinMode(SNES_LATCH_PIN, OUTPUT);
digitalWrite(SCREEN_SS_PIN, HIGH);
digitalWrite(SCREEN_SS_PIN, LOW);
clearDisplay();
controller[0] = 4;
controller[1] = 5;
controller[2] = 2;
controller[3] = 3; //pins on Arduino where the SNES-controller data pins are connected
MsTimer2::set(1, btnCallBack); //Autotriggering of the getButton-routine every 1ms
Serial.println("HW"); //DEBUG
#else
Serial.begin(500000);
MsTimer2::set(15, btnCallBack);
btnRequestSent = 0;
Serial.println("Sim"); //DEBUG
#endif
_screen_line = 0;
_screen_index = 0;
resetButtons();
setFont(FONT_5x7);
MsTimer2::start();
}
开发者ID:GameOfLight,项目名称:Source,代码行数:35,代码来源:GameOfLight.cpp
示例13: initializeDisplay
void initializeDisplay()
{
pinMode(R1_PIN,OUTPUT);
pinMode(G1_PIN,OUTPUT);
pinMode(B1_PIN,OUTPUT);
pinMode(R2_PIN,OUTPUT);
pinMode(G2_PIN,OUTPUT);
pinMode(B2_PIN,OUTPUT);
pinMode(CLK_PIN,OUTPUT);
pinMode(OE_PIN,OUTPUT);
pinMode(A_PIN,OUTPUT);
pinMode(B_PIN,OUTPUT);
pinMode(C_PIN,OUTPUT);
pinMode(D_PIN,OUTPUT);
pinMode(LAT_PIN,OUTPUT);
pinOutput(A_PIN, 0);
pinOutput(B_PIN, 0);
pinOutput(C_PIN, 0);
pinOutput(D_PIN, 0);
pinOutput(LAT_PIN, 0);
pinOutput(OE_PIN, 0);
pinOutput(CLK_PIN, 1);
clearDisplay();
startTimer(TC1, 0, TC3_IRQn, 100); //TC1 channel 0, the IRQ for that channel and the desired frequency
}
开发者ID:kimocode,项目名称:CalPolyLEDBoard,代码行数:27,代码来源:display.cpp
示例14: pinMode
LedControl::LedControl(int dataPin, int clkPin, int csPin, int numDevices) {
LEDCONTROL_SPI_MOSI=dataPin;
LEDCONTROL_SPI_CLK=clkPin;
LEDCONTROL_SPI_CS=csPin;
if(numDevices<=0 || numDevices>8 )
numDevices=8;
maxDevices=numDevices;
pinMode(LEDCONTROL_SPI_MOSI,OUTPUT);
pinMode(LEDCONTROL_SPI_CLK,OUTPUT);
pinMode(LEDCONTROL_SPI_CS,OUTPUT);
digitalWrite(LEDCONTROL_SPI_CS,HIGH);
LEDCONTROL_SPI_MOSI=dataPin;
for(int i=0;i<64;i++)
status[i]=0x00;
for(int i=0;i<maxDevices;i++) {
spiTransfer(i,OP_DISPLAYTEST,0);
//scanlimit is set to max on startup
setScanLimit(i,7);
//decode is done in source
spiTransfer(i,OP_DECODEMODE,0);
clearDisplay(i);
//we go into shutdown-mode on startup
shutdown(i,true);
}
}
开发者ID:lyneca,项目名称:ncss_robotics,代码行数:25,代码来源:LedControlMS.cpp
示例15: main
void main(void)
{
unsigned char tmp;
unsigned char x = 0;
P1_4 = 1;
//P1_4 = 0;
fb_init();
keyboard_init();
EA = 1; // enable global interrupts
clearDisplay();
drawRectangle(0,0,13,19);
while(1) {
/*
tmp = readBuf();
if(tmp == 0x34)
{
if(x == 0){
setPx(2,2);
x = 1;
}
else {
clearPx(2,2);
x = 0;
}
}
*/
}
}
开发者ID:schuere,项目名称:hnseBoard,代码行数:34,代码来源:main.c
示例16: playf
void playf(void)
{ clearDisplay();
m_port_set(0x20, PORTG,4); //Display 1
m_port_set(0x20, PORTG,6);
state = 0x00;
}
开发者ID:jason1081,项目名称:robockey,代码行数:8,代码来源:goalie+(Jason+Gui's+conflicted+copy+2012-12-06).c
示例17: clearDisplay
void OpenglManager::clearAllDisplays()
{
for (int disp = 0; disp < GLDisplay::numDisplays; disp++)
{
clearDisplay((GLDisplay::display)disp);
}
return;
}
开发者ID:josiahw,项目名称:robocup,代码行数:8,代码来源:openglmanager.cpp
示例18: main
void main() {
unsigned char x, y, xVel, yVel;
// === Initialize system ================================================
IFG1=0; /* clear interrupt flag1 */
WDTCTL=WDTPW+WDTHOLD; /* stop WD */
init();
initNokia();
clearDisplay();
x=4; y=4; xVel=1; yVel=1;
drawBlock(y,x);
while(1) {
// Vel = 1 going right/down
// Vel = 0 going left/up
if (xVel == 1) {
x++;
if (x>=11) xVel=0;
}
if (xVel == 0) {
x--;
if (x<=0) xVel=1;
}
if (yVel == 1) {
y++;
if (y>=7) yVel=0;
}
if (yVel == 0) {
y--;
if (y<=0) yVel=1;
}
clearDisplay();
drawBlock(y,x);
delayDraw();
}
}
开发者ID:KyleJonas,项目名称:ECE382,代码行数:45,代码来源:lab4B.c
示例19: pinMode
Me7SegmentDisplay::Me7SegmentDisplay(uint8_t dataPin,uint8_t clkPin)
{
s1 = dataPin;
s2 = clkPin;
pinMode(s2, OUTPUT);
pinMode(s1, OUTPUT);
set();
clearDisplay();
}
开发者ID:shao-kai,项目名称:makeblock_new_lib,代码行数:9,代码来源:Me7SegmentDisplay.cpp
示例20: pinMode
/**
* Alternate Constructor which can call your own function to map the 7-Segment display to arduino port.
* \param[in]
* dataPin - The DATA pin for Seven-Segment LED module(arduino port).
* \param[in]
* clkPin - The CLK pin for Seven-Segment LED module(arduino port).
*/
Me7SegmentDisplay::Me7SegmentDisplay(uint8_t dataPin, uint8_t clkPin)
{
_dataPin = dataPin;
_clkPin = clkPin;
pinMode(_clkPin, OUTPUT);
pinMode(_dataPin, OUTPUT);
set();
clearDisplay();
}
开发者ID:Suddel-T,项目名称:Makeblock-Libraries,代码行数:16,代码来源:Me7SegmentDisplay.cpp
注:本文中的clearDisplay函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论