int main(void) { int x1=0; char *menu[]={"1.한글 타자연습","2.영문 타자연습", "3.테트리스", "4.끝내기"}; char ch; int color[]={9,10,11,12,13,14}; int ccur=0; int time1; int time2; noCursor(); Func_table(); Func_JDT(color[ccur]); Menu_print(menu,x1, 4); time1=GetTickCount(); while(1) { time2=GetTickCount(); if(time2-time1>1000){ if(ccur==5) ccur=0; ccur++; Func_JDT(color[ccur]); time1=GetTickCount(); } if(kbhit()) { ch=getch(); if(ch==-32 || ch==ENTER || ch==ESC) { if(ch!=ENTER && ch!=ESC) ch=getch(); switch(ch) { case UP: if(x1>0) x1--; break; case DOWN: if(x1<3) x1++; break; case ENTER: main_select(x1); Func_table(); Func_JDT(color[ccur]); break; case ESC: cls(); return 0; } Menu_print(menu,x1, 4); } } } }
void setup() { size(displayWidth, displayHeight); noCursor(); img1 = loadImage("../3rdparty/nanovg/example/images/image9.jpg"); img2 = loadImage("../3rdparty/nanovg/example/images/image10.jpg"); font = loadFont("../3rdparty/nanovg/example/Roboto-Regular.ttf"); }
//Setter void LCDShield::begin() { clear(); noAutoScroll(); setCursor(0,0); noCursor(); noBlink(); }
void ParallaxSerialLCD::begin(uint8_t cols, uint8_t rows, boolean startEmpty){ pinMode(_bv[PINOUT], OUTPUT); delay(_bv[BOUNCE]); SoftwareSerial::begin(19200); delay(_bv[BOUNCE]); _bv[NUMROWS]=rows; _bv[NUMCOLS]=cols; if (startEmpty) { clear(); } noCursor(); }
void LiquidCrystalFast::setCursor(uint8_t col, uint8_t row) // this can be called by the user but is also called before writing some characters. { if ( row > _numlines ) { row = _numlines-1; // we count rows starting w/0 } _y = row; _x = col; _setCursFlag = 0; //user did a setCursor--clear the flag that may have been set in write() int8_t high_bit = row_offsets[row] & 0x40; // this keeps coordinates pegged to a spot on the LCD screen even if the user scrolls right or int8_t offset = col + (row_offsets[row] &0x3f) + _scroll_count; //left under program control. Previously setCursor was pegged to a location in DDRAM //the 3 quantities we add are each <40 if (offset > 39) offset -= 40; // if the display is autoscrolled this method does not work, however. if (offset < 0) offset += 40; offset |= high_bit; if (_chip != (row & 0b10)) noCursor(); //turn off cursor on chip we are leaving _chip = row & 0b10; //if it is row 0 or 1 this is 0; if it is row 2 or 3 this is 2 command(LCD_SETDDRAMADDR | (byte) offset ); }
void SerialLCD::init(uint8_t cols, uint8_t lines, uint8_t dotsize) { _displayfunction = LCD_4BITMODE; // | LCD_1LINE; // | LCD_5x8DOTS; _numlines = 1; bounceDelay = 4; delay(bounceDelay); _numcolumns = cols; _numlines = lines; if (lines > 1) { _displayfunction |= LCD_2LINE; } else { _displayfunction |= LCD_1LINE; } // for some 1 line displays you can select a 10 pixel high font if ((dotsize != 0) && (lines == 1)) { _displayfunction |= LCD_5x10DOTS; } currow = 0; curcol = 0; // finally, set # lines, font size, etc. command(LCD_FUNCTIONSET | _displayfunction); // turn the display on with no cursor or blinking default _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; display(); // clear it off clear(); // Initialize to default text direction (for romance languages) _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; // set the entry mode command(LCD_ENTRYMODESET | _displaymode); //------ backlightOn(); noCursor(); }
void main() { int ch; x = 5; /*처음 좌표 */ y = 2; noCursor(); /* 커서 지움 */ printMap(); /* 맵 그리기 */ printBlock(); /* 블록 출력 */ for (; 1;) { //블록 움직임 반복 if (kbhit()) { // 키입력 처리 --------------------------------- clearBlock(); ch = getch(); if (ch == 0xE0) { //방향키를 눌럿을 때× ch = getch(); switch (ch) { case LEFT: x--; break; case RIGHT: x++; break; case DOWN: y++; break; case UP: sh++; if (sh > 3) sh = 0; break; } } printBlock(); } // ------------------- 키입력 처리 종료 Sleep(100); /* 0.1초간 대기 */ } }
void ready(int level) { char* menu[3]={ "ΓΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΔ", "Β Β", "ΖΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΑΕ"}; int x=9, y=5; int i; cls(); noCursor(); textcolor(CC_FONT_RED, 0); gotoxy(x, y), printf("%s", menu[0]); for(i=1; i<7; i++) gotoxy(x, y+i), printf("%s", menu[1]); gotoxy(x, y+i), printf("%s", menu[2]); textcolor(CC_FONT_WHITE, 0); textcolor(CC_FONT_GREEN, 0); gotoxy(23, 7), printf("Stage %2d 聖 獣拙杯艦陥.", level); textcolor(CC_FONT_WHITE, 0); textcolor(CC_FONT_WHITE, CC_BACK_DYELLOW); gotoxy(32, 10), printf("溌昔"); textcolor(CC_FONT_WHITE, 0); while(1) { int temp; temp=getch(); if(temp==13) break; } }
void LiquidCrystal_I2C::cursor_off(){ noCursor(); }
void ActiveGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) { emit noCursor(); QGraphicsItemGroup::hoverLeaveEvent(event); }
void T123::cursor_off(){ noCursor(); }
//---------- Affichage du curseur /*EDU FR*/ void rgb_lcd::desactiverCurseur(){noCursor();}
void PCF8574_HD44780_I2C::cursor_off(){ noCursor(); }
//Main function (execution starts here after startup file) int main(void) { int i; int e; uint16_t temperature; init_GPIO_pins(); //Short delay during which we can communicate with MCU via debugger even if later user code causes error such as sleep state with no wakeup event that prevents debugger interface working //THIS MUST COME BEFORE ALL USER CODE TO ENSURE CHIPS CAN BE REPROGRAMMED EVEN IF THEY GET STUCK IN A SLEEP STATE LATER for (i = 0; i < 1000000; i++) { LED_on(); } GPIO_Init_Mode(GPIOA,GPIO_Pin_0,GPIO_Mode_IN_FLOATING); //User button. GPIO_Init_Mode(GPIOC,GPIO_Pin_11,GPIO_Mode_IN_FLOATING); //Accelerometer interrupt. delay_init(); LED_off(); LCDINIT(); home(); clear(); display(); //Surely some of these can be commented out. noCursor(); noBlink(); standby(); UART_init(); humidity_init(); ADC_init(); I2C_EEPROM(); I2C_ACCEL_INIT(); I2C_EE_LoadConfig(); logging_timer_init(); // I2C_EE_BufferWrite(Test_Buffer, EEPROM_WriteAddress1, 100); //I2C_EE_BufferRead(buffer, 0, 100); /*while(1){ if(LEDbyte==512){LEDbyte=1;} else {LEDbyte=LEDbyte<<1;} setLEDS(); setCursor(0,1); temperature=getTemperature(); writenumber( temperature/100); write('.'); writenumber((temperature/10)%10); write(' '); write(0xDF); write('C'); setCursor(0,0); writenumber(readhumidity(24)); //Needs real temperature write(' '); write('%'); write('R'); write('H'); delay_ms(50); check_and_process_received_command(); }*/ //currentstate=UPLOADING; while(1) { switch (currentstate){ case WAITING: if (GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0)) //Polling is probably ok here, since the loop will be very very fast. { currentstate=LOGGING; clear(); write('S'); write('t'); write('a'); write('r'); write('t'); write('i'); write('n'); write('g'); delay_ms(2000); clear(); I2C_EE_StartLog(); TIM4->CNT=0; } break; case LOGGING: if (GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0)){currentstate=WAITING;I2C_EE_FinishLog();break;} //Polling is probably ok here, since the loop will be very very fast. LEDbyte|= 1<<8; setLEDS(); if (TIM_GetFlagStatus(TIM3, TIM_FLAG_Update) != RESET) { TIM_ClearFlag(TIM3, TIM_IT_Update); temperature = getTemperature(); LogBuffer[0]=(temperature>>8)&0xFF; LogBuffer[1]=temperature&0xFF; LogBuffer[2]=readhumidity(LogBuffer[0]); I2C_ACCEL_READ(); I2C_EE_Log(LogBuffer); setCursor(0,1); writenumber(temperature/100); write('.'); writenumber(temperature%100); write(' '); write(0xDF); write('C'); write(' '); setCursor(0,0); writenumber(25); //Needs real temperature write(' '); write('%'); write('R'); write('H'); write(' '); LEDbyte&= ~(1<<8); setLEDS(); } break; case UPLOADING: currentstate=WAITING; I2C_EE_Upload(); break; case ERASING: currentstate=WAITING; I2C_EE_Erase(); break; case STREAMING: if (TIM_GetFlagStatus(TIM3, TIM_FLAG_Update) != RESET) { TIM_ClearFlag(TIM3, TIM_IT_Update); temperature = getTemperature(); LogBuffer[0]=(temperature>>8)&0xFF; LogBuffer[1]=temperature&0xFF; LogBuffer[2]=readhumidity(LogBuffer[0]); I2C_ACCEL_READ(); // I2C_EE_Log(LogBuffer); for (e=0;i<ENTRYBYTES;i++) { UART_send_byte(LogBuffer[e]); } setCursor(0,1); writenumber(temperature/100); write('.'); writenumber(temperature%100); write(' '); write(0xDF); write('C'); write(' '); setCursor(0,0); writenumber(25); //Needs real temperature write(' '); write('%'); write('R'); write('H'); write(' '); LEDbyte&= ~(1<<8); setLEDS(); } break; }
void tinyLCD_I2C::cursor_off(){ noCursor(); }
//영문 긴글연습 메뉴 void englong_menu(void) { int x1=0; char ch; char* menu[]={"1.The Selfish Giant", "2.The Elves and the Shoemaker", "3.Rapunzel", "4.Narcissus","5.이전 메뉴로"}; int color[]={9,10,11,12,13,14}; int ccur=0; int time1; int time2; Func_table(); Func_JDT(color[ccur]); Menu_print(menu,x1, 5); time1=GetTickCount(); noCursor(); while(1) { time2=GetTickCount(); if(time2-time1>1000){ if(ccur==5) ccur=0; ccur++; Func_JDT(color[ccur]); time1=GetTickCount(); } while(1) { ch=getch(); if(ch==-32 || ch==ENTER || ch==ESC) { if(ch!=ENTER && ch!=ESC) ch=getch(); switch(ch) { case UP: if(x1>0) x1--; break; case DOWN: if(x1<4) x1++; break; case ENTER: if(x1==0) { long_kor("The Selfish Giant.dat",Func_line("The Selfish Giant.dat")); Func_table(); } else if(x1==1) { long_kor("The Elves and the Shoemaker.dat",Func_line("The Elves and the Shoemaker.dat")); Func_table(); } else if(x1==2) { long_kor("Rapunzel.dat",Func_line("Rapunzel.dat")); Func_table(); } else if(x1==3) { long_kor("Narcissus.dat",Func_line("Narcissus.dat")); Func_table(); } else if(x1==4) return; break; case ESC: return; } Menu_print(menu,x1, 5); } } } }