当前位置: 首页>>代码示例>>C++>>正文


C++ display_string函数代码示例

本文整理汇总了C++中display_string函数的典型用法代码示例。如果您正苦于以下问题:C++ display_string函数的具体用法?C++ display_string怎么用?C++ display_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了display_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: display_goto_xy

int UI::courseSelect(){
	int course = -1;

	display_goto_xy(4, 1);

	while(1){
		if(ecrobot_is_RUN_button_pressed()){
			course = course * (-1);

			if(course == 1){
				display_string(" IN COURSE");
				display_goto_xy(4, 1);
			}
			else{
				display_string("OUT COURSE");
				display_goto_xy(4, 1);
			}
		}		

		if(ecrobot_is_ENTER_button_pressed()){
			display_goto_xy(6, 3);
			display_string("READY");
			break;
		}
		
		display_update();
		
		// 500msecウェイトする
		systick_wait_ms(500); 	
	}

	display_update();

	return course;
}
开发者ID:fujiwara1525,项目名称:ETrobo,代码行数:35,代码来源:UI.cpp

示例2: TestIRSeeker

void TestIRSeeker(U8 port_id)
{
	S8 data[6];

	ecrobot_get_ir_seeker(port_id, data);

	display_goto_xy(0, 0);
	display_string("IR SEEKER TEST");

	display_goto_xy(0, 1);
	display_string("DIR: ");
	display_int(data[0], 0);

	display_goto_xy(0, 2);
	display_string("INT1/2: ");
	display_int(data[1], 0);
	display_int(data[2], 5);

	display_goto_xy(0, 3);
	display_string("INT3/4: ");
	display_int(data[3], 0);
	display_int(data[4], 5);

	display_goto_xy(0, 4);
	display_string("INT5: ");
	display_int(data[5], 0);
}
开发者ID:martin-au,项目名称:NXtpandedLib,代码行数:27,代码来源:hitechtest.c

示例3: view_pic

/***********************************************************
* view pic
************************************************************/
void view_pic(fb_info fb_inf, char name[4][20])
{
	display_one("background/view.jpg",fb_inf);
    
	int size = 32 * fb_inf.w/1024;
	
	if(init_ft("font/type.ttf", size) != 0)
	{
		fprintf(stderr, "Error initial font\n");
		return;
	}

	int x = fb_inf.w/4 - size * 3/2;
	int y = fb_inf.h - 20 * fb_inf.h/768;

	display_string("上一页", x, y, fb_inf, COLOR);
	display_string("下一页", x + fb_inf.w/2, y, fb_inf, COLOR);

	int i;
   
	for(i = 0; i < 4; i++)
	{
		char path[128]="image/";
		strncat(path,name[i],strlen(name[i]) - 1);
		if(strstr(path,".jpg") != NULL)
			show(path, fb_inf, i);
	}  
	
}
开发者ID:sunqi08201329,项目名称:0208,代码行数:32,代码来源:view.c

示例4: select_menu

// Handles different menu selection
//
// leftRightIndex: index for determining menus
// upDownIndex, currDollars, currCents: needed for calling print_menu
void select_menu(int *leftRightIndex, int upDownIndex, int currDollars, int currCents) {
  if (*leftRightIndex == 0) {
      print_welcome();
  } else if (*leftRightIndex == 1) {
    print_menu(upDownIndex, currDollars, currCents);
  }
  else {
    clear_display();
    delay(1000); //1ms
    LED_toggle();
    display_string("Order Confirmed!");
    display_string("                        ");
    delay(1000000); //1sec
    display_string("Preparing Now...");
    delay(3000000); //3sec
    clear_display();
    delay(1000); //1ms
    display_string("Order Ready!");
    LED_toggle();
    delay(3000000); //3sec
    *leftRightIndex = 0;
    clear_display();
    delay(1000); //1ms
    print_welcome();
  }
}
开发者ID:mgolub2,项目名称:EE472_lab3,代码行数:30,代码来源:main.c

示例5: TestCompassSensor

void TestCompassSensor(U8 port_id)
{
	display_goto_xy(0, 0);
	display_string("COMPASS TEST");

	display_goto_xy(0, 1);
	display_string("HEADING: ");
	display_int(ecrobot_get_compass_sensor(port_id), 0);
}
开发者ID:martin-au,项目名称:NXtpandedLib,代码行数:9,代码来源:hitechtest.c

示例6: display_byte_hex

void display_byte_hex(u8 c){
	char output[2];
	u8 low=c&0xF,high=c>>4;
	memset(output,0,sizeof(output));
	if (high<=9) output[0]=high+'0'; else output[0]=high-10+'A';
	display_string(output);
	if (low<=9) output[0]=low+'0'; else output[0]=low-10+'A';
	display_string(output);
}
开发者ID:mengpq,项目名称:os,代码行数:9,代码来源:main.c

示例7: main

int main(void) {
	/* Set up peripheral bus clock */
        /* OSCCONbits.PBDIV = 1; */
  /*OSCCONCLR = 0x100000; /* clear PBDIV bit 1 */
	OSCCONSET = 0x080000; /* set PBDIV bit 0 */

	/* Set up output pins */
	AD1PCFG = 0xFFFF;
	ODCE = 0x0;
	TRISECLR = 0xFF;
	PORTE = 0x0;

	/* Output pins for display signals */
	PORTF = 0xFFFF;
	PORTG = (1 << 9);
	ODCF = 0x0;
	ODCG = 0x0;
	TRISFCLR = 0x70;
	TRISGCLR = 0x200;

	/* Set up input pins */
	TRISDSET = (1 << 8);
	TRISFSET = (1 << 1);

	/* Set up SPI as master */
	SPI2CON = 0;
	SPI2BRG = 4;
	/* SPI2STAT bit SPIROV = 0; */
	SPI2STATCLR = 0x40;
	/* SPI2CON bit CKP = 1; */
        SPI2CONSET = 0x40;
	/* SPI2CON bit MSTEN = 1; */
	SPI2CONSET = 0x20;
	/* SPI2CON bit ON = 1; */
	SPI2CONSET = 0x8000;

	display_init();
	display_string(0, "Vi är så bra!!!");
	display_string(1, "Det löser sig!");
	display_string(2, ":)");
	display_string(3, "Kämpa!");
	display_update();

	display_image(96, icon);

	labinit(); /* Do any lab-specific initialization */

	while( 1 )
	{
	  labwork(); /* Do lab-specific things again and again */
	}
	return 0;
}
开发者ID:Byssis,项目名称:Labb3,代码行数:53,代码来源:mipslabmain.c

示例8: exit_game

void exit_game()
{
    IEC(0) = ~0xFFFF;
    display_string(0, "                ");
    display_string(1, "   Game Over    ");

    char str[16] = "  Score: ";
    char *scr = itoaconv(score);
    for(int i = 9; *scr; str[i] = *scr++, i++);
    display_string(2, str);

    display_update_text();
    for(;;);
}
开发者ID:EmilGedda,项目名称:PIC32-Tetris,代码行数:14,代码来源:score.c

示例9: draw

void draw(){
	if(testunit==0){
		display_string(2,title);
		display_string(3,author);
	}else if(testunit==1){
		display_string(1,string_line);
		draw_line(20+frame*4,20,40+frame*4,40);
		draw_line(40+frame*4,20,20+frame*4,40);
		draw_line(30+frame*4,20,30+frame*4,40);
		draw_line(20+frame*4,30,40+frame*4,30);
	}else if(testunit==2){
		display_string(1,string_box);
		draw_box(20,20,20,20,0);
		draw_box(30+frame*4,30,20,20,1);
	}else if(testunit==3){
		display_string(1,string_circle);
		draw_circle(30,30,10,0);
		draw_circle(40+frame*4,40,10,1);
	}else if(testunit==4){
		display_string(1,string_font1);
		display_string_58(0,15,test_string_l,0,1);
		display_string_58(0,24,test_string_l_2,0,1);
		display_string_58(0,33,test_string_s,0,1);
		display_string_58(0,42,test_string_s_2,0,1);
	}else if(testunit==5){
		display_string(1,string_font1);
		display_string_58(20+frame*2,20,test_string,90,1);
	}else if(testunit==6){
		display_string(1,string_font1);
		display_string_58(40+frame*2,30,test_string,180,1);
	}else if(testunit==7){
		display_string(1,string_font1);
		display_string_58(20+frame*2,40,test_string,270,1);
	}else if(testunit==8){
		display_string(2,finish);
	}
	if(frame==15){
		frame=0;
		if(testunit==8){
			;
		}else{
			testunit++;
		}
	}else{
		frame++;
	}
	delayms(100);
}
开发者ID:pikipity,项目名称:QC12864B_8051,代码行数:48,代码来源:glcd_test.c

示例10: labwork

/* This function is called repetitively from the main program */
void labwork( void )
{
  
  prime = nextprime ( prime );
  display_string ( 0, itoaconv( prime ));
  display_update();
}
开发者ID:robertab,项目名称:is1500,代码行数:8,代码来源:mipslabwork.c

示例11: user_isr

/* Interrupt Service Routine */
void user_isr( void )
{
	/*T2IF = IFS0 8
	T2IE = IEC0 8
	T2IP = IPC2 26-28
	T2IS = IPC2 24/25
	*/
	//if interrupt clear T2IF and timer counter
	if(IFS(0) & 0x100){
	IFSCLR(0) = 0x100;
	TMR2 = 0;
	if(timeoutcount < 9){
		timeoutcount++;
	}else{
		//print on screen once a second
		timeoutcount = 0;
		time2string(textstring, mytime);
		display_string(3, textstring);
		display_update();
		tick(&mytime);
		//*portE += 1;
		//display_image(96, icon);
	}
}

	if(IFS(0) & 0x8000){
		IFSCLR(0) = 0x8000;
		*portE += 1;
	}
}
开发者ID:sirrefirre,项目名称:dt,代码行数:31,代码来源:mipslabwork.c

示例12: reset_disp_list

// draw the geometry marker in the given Displayable's drawing list
void GeometryBond::create_cmd_list() {
  char valbuf[32];

  // get the transformed positions, and draw a line between them
  float pos1[3], pos2[3];

  reset_disp_list();
  if(!transformed_atom_coord(0, pos1))
    return;
  if(!transformed_atom_coord(1, pos2))
    return;

  append(DMATERIALOFF);
  DispCmdColorIndex cmdColor;
  cmdColor.putdata(my_color, cmdList);

  DispCmdLineType cmdLineType;
  DispCmdLineWidth cmdLineWidth;
  cmdLineType.putdata(DASHEDLINE, cmdList);
  cmdLineWidth.putdata(4, cmdList);

  // print value of distance at midpoint
  midpoint(valuePos, pos1, pos2);
  // left-align the value so that it doesn't appear to shift its position
  // when the label text size changes.  Shift it to the right by a constant
  // amount so that it doesn't intersect the line.
  valuePos[0] += 0.05f;
  sprintf(valbuf, "%-7.2f", geomValue);
  display_string(valbuf, cmdList);

  // draw a line into the given Displayable
  display_line(pos1, pos2, cmdList);
  
}
开发者ID:gzoppetti,项目名称:ExscitechVmd,代码行数:35,代码来源:GeometryBond.C

示例13: user_isr

/* Interrupt Service Routine */
void user_isr( void ) {

  // check flag
  if(IFS(0) & 0x100){
    // clearing flag
    IFS(0) = 0;
    timeoutcount++;

    if (timeoutcount == 10){
      time2string( textstring, mytime );
      display_string( 3, textstring );
      display_update();
      tick( &mytime );
      timeoutcount = 0;
    }
  }
    
  // code for counting LED
  if(IFS(0) & 0x80){
    // clearing flag
    IFS(0) = 0;
    // for LEDs ticking
    * portE =  * portE + 0x1;
    // only for the last 8 bits
    * E = * E & 0xFF00;
  }

  return;
}
开发者ID:GaPhil,项目名称:COMPUTER-HARDWARE-ENGINEERING-IS1200,代码行数:30,代码来源:mipslabwork.c

示例14: display_params

void display_params(){
	display_string(-0.9f, 0.9f, "reset: i");
	std::stringstream ss;
	ss.str("");
	ss << "1< >2 f: " << rd.get_f();
	display_string(-0.9f, 0.82f, ss.str());
	ss.str("");
	ss << "q< >w k: " << rd.get_k();
	display_string(-0.9f, 0.74f, ss.str());
	ss.str("");
	ss << "a< >s ru:" << rd.get_ru();
	display_string(-0.9f, 0.66f, ss.str());
	ss.str("");
	ss << "z< >x rv:" << rd.get_rv();
	display_string(-0.9f, 0.58f, ss.str());
}
开发者ID:So-Takamoto,项目名称:rd_system,代码行数:16,代码来源:rd_sim.cpp

示例15: fprintf

fprintf (int ign, int a1, int a2, int a3, int a4, int a5, int a6, int a7,
	 int a8, int a9)
{
  char buffer[1024];
  sprintf (buffer, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  display_string (buffer);
}
开发者ID:jichu4n,项目名称:prc-tools-remix,代码行数:7,代码来源:standalone.c


注:本文中的display_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。