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


C++ printChar函数代码示例

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


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

示例1: printString

void printString(const char *s)
{
    while(*s) {
        printChar(*s);
        s++;
    }
}
开发者ID:cody82,项目名称:cheali-charger-i1,代码行数:7,代码来源:SerialLog.cpp

示例2: displayDebugStack

/**
 * Display the debugging messages in the ncurses window
 */
void displayDebugStack(const WINDOW* window) {
    if (DEBUG_STACK->head == NULL) {
        return;
    }

    int maxY = 24;
    int maxX = 80;
    getmaxyx(window, maxY, maxX);

    for (int y=1; y <= 3; y++) {
        for (int x=0; x <= maxX; x++) {
            MapCoordinate position = initMapCoordinate(x, y);
            printChar(' ', position, BLACK_ON_WHITE);
        }
    }

    // Print three most recent debug messages
    DebugNode* current = DEBUG_STACK->current;
    if (current != NULL) {
        printDebug(current, 3);
        current = current->previous;
        if (current != NULL) {
            printDebug(current, 2);
            current = current->previous;
            if (current != NULL) {
                printDebug(current, 1);
            }
        }
    }
}
开发者ID:mes32,项目名称:folly,代码行数:33,代码来源:debugfolly.c

示例3: movePlayer

void movePlayer(PLAYER (*ppp)[], int i, int dir) {
	PLAYER *p = &(*ppp)[i];
	POSITION oldPosition = (*p).obj.pos;
	POSITION newPosition = getNewPosition(oldPosition, dir);
	if (isPositionValid(newPosition, dir)) {
		// save move if not yet finished:
		if ((*p).finished != 1) {
			saveMove(p, dir);
		}
		// if player crossed the line, finished flag is set to true:
		if (crossedTheLine(oldPosition, dir)) {
			(*p).finished = 1;
		}
		int symbol = getSymbolOnTheTrack(oldPosition);
		erasePlayer(p); 
		// if player was on the finish line, draw finish line:
		if (symbol == '|') { 
			printChar('|', oldPosition);
		}
		(*p).obj.pos = newPosition;
		// so that if two were on the same spot both get printed:
		printAllPlayers(ppp);
		// so that it if two are on the same spot the last that arrived gets printed:
		printPlayer(p); 
	}
}
开发者ID:gto76,项目名称:race,代码行数:26,代码来源:term.c

示例4: pn

/**
 * Prints an integer value
 * @param input The unsigned value.
 */
void pn(unsigned int input)
{
	int ldb = input % 10;
	int n = (int) input / 10;
	if (input > 9) pn(n);
	printChar(ldb + 48);
}
开发者ID:yannickulrich,项目名称:LionOS.core,代码行数:11,代码来源:screen.c

示例5: if

void TFT_ScaleFonts::rotateChar(byte c, int x, int y, int pos, int S, int deg)
{
  if (S < 1) S = 1;

  if ((S == 1) && (deg == 0))
  {
    _Disp->printChar(c, x, y);
    return;
  }
  else if (S == 1)
  {
    _Disp->rotateChar(c, x, y, pos, deg);
    return;
  }
  else if (deg == 0)
  {
    printChar(c, x, y, S);
    return;
  }

  byte i, j, ch;
  word temp;
  int newx, newy;
  double radian;
  radian = deg * 0.0175;

  cbi(_Disp->P_CS, _Disp->B_CS);

  temp = ((c - _Disp->cfont.offset) * ((_Disp->cfont.x_size / 8) * _Disp->cfont.y_size)) + 4;
  for (j = 0; j < _Disp->cfont.y_size * S; j += S)
  {
    for (int zz = 0; zz < (_Disp->cfont.x_size / 8)*S; zz += S)
    {
      ch = pgm_read_byte(&_Disp->cfont.font[temp + (zz / S)]);
      for (i = 0; i < (8 * S); i++)
      {
        for (int s = 0; s < S; s++)
        {
          newx = x + (((i + (zz * 8) + (pos * _Disp->cfont.x_size)) * cos(radian)) - ((j + s) * sin(radian)));
          newy = y + (((j + s) * cos(radian)) + ((i + (zz * 8) + (pos * _Disp->cfont.x_size)) * sin(radian)));

          _Disp->setXY(newx, newy, newx + 1, newy + 1);

          if ((ch & (1 << (7 - (i / S)))) != 0)
          {
            _Disp->setPixel((_Disp->fch << 8) | _Disp->fcl);
          }
          else
          {
            if (!_Disp->_transparent)
              _Disp->setPixel((_Disp->bch << 8) | _Disp->bcl);
          }
        }
      }
    }
    temp += (_Disp->cfont.x_size / 8);
  }
  sbi(_Disp->P_CS, _Disp->B_CS);
  _Disp->clrXY();
}
开发者ID:AndrewMascolo,项目名称:TFT_ScaleFonts,代码行数:60,代码来源:TFT_ScaleFonts.cpp

示例6: strlen

void TFT_ScaleFonts::print(char *st, int x, int y, int S, int deg)
{
  if (S < 1) S = 1;

  if (S == 1)
  {
    _Disp->print(st, x, y, deg);
    return;
  }

  int stl, i;

  stl = strlen(st);

  if (_Disp->orient == PORTRAIT)
  {
    if (x == RIGHT)
      x = ((Bound_X2 - Bound_X)/*_Disp->disp_x_size*/ + 1) - (stl * _Disp->cfont.x_size * S);
    if (x == CENTER)
      x = (((Bound_X2 - Bound_X) + 1) - (stl * _Disp->cfont.x_size * S)) / 2;
  }
  else
  {
    if (x == RIGHT)
      x = ((Bound_Y2 - Bound_Y) + 1) - (stl * _Disp->cfont.x_size * S);
    if (x == CENTER)
      x = (((Bound_Y2 - Bound_Y) + 1) - (stl * _Disp->cfont.x_size * S)) / 2;
  }

  for (i = 0; i < stl; i++)
    if (deg == 0)
      printChar(*st++, x + (i * (_Disp->cfont.x_size * S)), y, S);
    else
      rotateChar(*st++, x, y, i * S, S, deg);
}
开发者ID:AndrewMascolo,项目名称:TFT_ScaleFonts,代码行数:35,代码来源:TFT_ScaleFonts.cpp

示例7: printCharN

/*! Repeatedly prints a character specified by its ASCII code to the display.
    Most LCDs can also print some special characters, such as those in LCD.h.
    @param data The character to print to the LCD.
    @param times The number of times to print the character.
 */
void printCharN(const u08 data, const u08 times)
{
	for (u08 i = 0; i < times; i++)
	{
		printChar(data);
	}
}
开发者ID:weeatbrains,项目名称:cs596,代码行数:12,代码来源:LCD.c

示例8: sendHeader

void sendHeader(uint16_t channel)
{
//return; //ign

    CRC = 0;
    printChar('$');
    printUInt(channel);
    printD();
    printUInt(Program::programType+1);
    printD();

    printUInt(currentTime/1000);   //timestamp
    printChar('.');
    printUInt((currentTime/100)%10);   //timestamp
    printD();
}
开发者ID:cody82,项目名称:cheali-charger-i1,代码行数:16,代码来源:SerialLog.cpp

示例9: printConstant

static void printConstant( int lev, ASTNode node )
{
	indent( lev );
	switch (node->vConstExpr.type)
	{
	case inumberConst:
		ec_stderr_printf( "<const: %ld>", (long)node->vConstExpr.vInt );
		break;
	case fnumberConst:
		ec_stderr_printf( "<const: %g>", node->vConstExpr.vFloat );
		break;
	case charConst:
		if (isprint( (int) node->vConstExpr.vChar ))
			ec_stderr_printf( "<const: '%c'>", node->vConstExpr.vChar );
		else
		{
			ec_stderr_printf( "<const: '" );
			printChar( node->vConstExpr.vChar );
			ec_stderr_printf( "'>" );
		}
		break;
	case symbolConst:
		ec_stderr_printf( "<const: %s>", EcSymbolAt( node->vConstExpr.vSym ) );
		break;
	case stringConst:
		ec_stderr_printf( "<const: \"" );
		printString( node->vConstExpr.vString );
		ec_stderr_printf( "\">" );
		break;
	case objectConst:
		ec_stderr_printf( "<const: EC_OBJ 0x%08lX>", (unsigned long)node->vConstExpr.vObject );
		break;
	}
}
开发者ID:BackupTheBerlios,项目名称:elastic,代码行数:34,代码来源:ast.c

示例10: printWord

void printWord(int iline , int argc ,char **argv){
	int iarg;
	for(iarg = 1; iarg != argc; ++iarg) {
		char *c = argv[iarg];
		printChar(c,iline);
		printSpace(iarg , iline , argc);
	}
}
开发者ID:NeTTa,项目名称:espl,代码行数:8,代码来源:ascart.c

示例11: printInteger

void printInteger(int X){
  	int Y=getReverse(X);
  	while(Y>0)
	{
  	printChar(48+mod(Y,10));
  	Y=div(Y,10);
 	 }
}
开发者ID:DushyantaDhyani,项目名称:MiniOS,代码行数:8,代码来源:kernel.c

示例12: clearSerial

void MG2639_Cell::sendATCommand(const char * command)
{	
	clearSerial();	// Empty the UART receive buffer
	// Send the command:
	printString("AT"); // Print "AT"
	printString(command); // Print the command
	printChar('\r'); // Print a carriage return to end command
}
开发者ID:elpapais,项目名称:MG2639_Cellular_Shield,代码行数:8,代码来源:SFE_MG2639_CellShield.cpp

示例13: while

void Ticker::printString(const char* st)
// print a zero-terminated string which is stored in RAM
{
	while (*st) {
		printChar(*st);
		st++;
	}
}
开发者ID:fab4U,项目名称:PixBlock,代码行数:8,代码来源:ticker.cpp

示例14: printPlain_u08

//Prints an 8-bit unsigned integer as 1-3 digits (no padding). Example: "7"
void printPlain_u08(u08 number)
{
	//if there is a digit in the tens place
	if (number >= 10)
	{
		//if there is a digit in the hundreds place
		if (number >= 100)
		{
			//print the hundreds digit
			printChar((number / 100) + 48);
		}
		//print the tens digit
		printChar(((number % 100 ) / 10) + 48);
	}
	//always print the ones digit
	printChar((number % 10) + 48);
}
开发者ID:bgomberg,项目名称:TapeBot,代码行数:18,代码来源:display.c

示例15: printString

void printString(View *view, char *string, int size, int x, int y, Color mainColor, Color shadowColor) {
   int i=0;
   for (i=0;i<size;++i) {
      char c = *(string + i);
      int p = x + i*8;
      printChar(view, c, p, y, mainColor, shadowColor);
   }
}
开发者ID:shaojianqing,项目名称:SmileOS,代码行数:8,代码来源:charset.c


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