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


C++ eraseDisplay函数代码示例

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


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

示例1: main

task main () {
  nxtDisplayCenteredTextLine(0, "MindSensors");
  nxtDisplayCenteredBigTextLine(1, "TouchPnl");
  nxtDisplayCenteredTextLine(3, "Noise-a-Tron");
  nxtDisplayCenteredTextLine(5, "Connect sensor");
  nxtDisplayCenteredTextLine(6, "to S3");
  wait1Msec(2000);
  eraseDisplay();

  int x, y = 0;
  ubyte buttons = 0;
  int multiplierX = 10;
  int multiplierY = 10;
  while (true) {
    if (!MSTPgetTouch(MSTP, x, y, buttons))
      PlaySound(soundBlip);
    else if (isButtonTouched(buttons, BUTTON_L1))
      multiplierX = 10;
    else if (isButtonTouched(buttons, BUTTON_L2))
      multiplierX = 15;
    else if (isButtonTouched(buttons, BUTTON_L3))
      multiplierX = 20;
    else if (isButtonTouched(buttons, BUTTON_L4))
      multiplierX = 25;
    else if (isButtonTouched(buttons, BUTTON_R1))
      multiplierY = 10;
    else if (isButtonTouched(buttons, BUTTON_R2))
      multiplierY = 15;
    else if (isButtonTouched(buttons, BUTTON_R3))
      multiplierY = 20;
    else if (isButtonTouched(buttons, BUTTON_R4))
      multiplierY = 25;

    else if (x > 0 && y > 0)
    {
      PlayImmediateTone(x * multiplierX, 1);
      wait1Msec(10);
      PlayImmediateTone(y * multiplierY, 1);
      nxtSetPixel(x, y);
    }
    EndTimeSlice();
  }
}
开发者ID:SwerveRobotics,项目名称:ftcrobotc,代码行数:43,代码来源:mindsensors-touchpanel-test1.c

示例2: main

task main()
{
    int basketNumber;
    bool done = false;

    initializeRobot();

    waitForStart(); // Wait for the beginning of autonomous phase.

    wait1Msec(10000);

    disableDiagnosticsDisplay();
    eraseDisplay();

    basketNumber = findIRBeacon();
    nxtDisplayTextLine(5, "Beacon #%d", basketNumber);

    wait1Msec(300);

    if (basketNumber != -1) {
        if (compensation[basketNumber] < 0) {
            moveForward(abs(compensation[basketNumber]), 60);
        } else {
            moveBackward(compensation[basketNumber], 60);
        }
        /*for (int i = 0; i <= basketNumber; i++) {
            displayCaution();
            wait1Msec(500);
            displayBackward();
            wait1Msec(500);
        }
        displayRestingPulse();
        */
        dumpBlock();
    } else {
        basketNumber = 3;
    }

    //moveToRamp(basketNumber);

    while (true)
    {}
}
开发者ID:bact197736,项目名称:FTC-Team-25,代码行数:43,代码来源:delayDump.c

示例3: main

/*===================================================================================================================*/
task main() {

   int myServo;

   eraseDisplay();
   myServo = 250;
   servoTarget[servo1] = myServo;

   while(true) {
      if (nNxtButtonPressed == 1) {
         myServo = myServo + 5;
      } else if (nNxtButtonPressed == 2) {
         myServo = myServo - 5;
      }
      servoTarget[servo1] = myServo;
      nxtDisplayCenteredBigTextLine(3, "%d", ServoValue[servo1]);
      wait10Msec(2);
   }
}
开发者ID:IronEagles,项目名称:Optimus,代码行数:20,代码来源:standAloneServoTester.c

示例4: stopCalibration

// Stop the calibration and complain loudly if somethign goes wrong
void stopCalibration() {
  if (!HTMCstopCal(HTCOMPASS)) {
    eraseDisplay();
    nxtDisplayTextLine(1, "ERROR: Calibration");
    nxtDisplayTextLine(2, "has failed.");
    nxtDisplayTextLine(4, "Check connection");
    nxtDisplayTextLine(5, "and try again.");
    PlaySound(soundException);
    while(bSoundActive) EndTimeSlice();
    wait1Msec(5000);
    StopAllTasks();
  } else {
    nxtDisplayTextLine(1, "SUCCESS: ");
    nxtDisplayTextLine(2, "Calibr. done.");
    PlaySound(soundUpwardTones);
    while(bSoundActive) EndTimeSlice();
    wait1Msec(5000);
  }
}
开发者ID:EastsidePreparatorySchool,项目名称:EPSilonBlue,代码行数:20,代码来源:hitechnic-compass-test2.c

示例5: main

task main()
{
  long rate = 0;
  eraseDisplay();
  bNxtLCDStatusDisplay = true; // Enable top status line display
  writeDebugStream("Scanning for wifi sensor: ");
  rate = scanBaudRate();
  writeDebugStreamLine("%d baud", rate);
  configureWiFi();
  set_verbose(false);
  Receive();
  wait1Msec(100);
  closeAllConns();
  wait1Msec(1000);
  clear_read_buffer();
  startListen(80);
  clear_read_buffer();
  parseInput();
}
开发者ID:sohamsankaran,项目名称:Newton,代码行数:19,代码来源:DIWIFI-test1.c

示例6: main

task main() {
  byte inputs = 0;

  nxtDisplayCenteredTextLine(0, "HiTechnic");
  nxtDisplayCenteredBigTextLine(1, "Proto");
  nxtDisplayCenteredTextLine(3, "Test 2");
  nxtDisplayCenteredTextLine(5, "Connect HTPB");
  nxtDisplayCenteredTextLine(6, "to S1");
  wait1Msec(2000);

  while(true) {
    eraseDisplay();
    // Fetch the state of the digital IO pins.  When not explicitly
    // configured as input or output, they will default to input.
    inputs = HTPBreadIO(HTPB, 0x3F);
    nxtDisplayTextLine(4, "D: 0x%x", ubyteToInt(inputs));
    wait1Msec(100);
  }
}
开发者ID:IronRiders,项目名称:Cascade-Effect,代码行数:19,代码来源:HTPB-test2.c

示例7: selectStartLocation

////////////////////////////////////////////////////////////////////////////////
//Select Robot Start Location (Wall) -----------------------------------------//
////////////////////////////////////////////////////////////////////////////////
void selectStartLocation()
{
	eraseDisplay();
	// Enable Top Line NXT Display (Bluetooth, NXT Name & Battery Status)
	//bNxtLCDStatusDisplay = true;
	while(true)
	{
		nxtDisplayCenteredTextLine(1,"DITU SAYS WEAR");
		nxtDisplayCenteredTextLine(2,"SAFETY GLASSES");
		nxtDisplayCenteredTextLine(4,"Start Location:");
		//------------------------------------------------
		if(nNxtButtonPressed == 1)	// NXT Right Triangle Button
		{
			robotStartLocation++;
			wait1Msec(400);
		}
		//-------------------------------------------------
		if(nNxtButtonPressed == 2)	// NXT Left Triangle Button
		{
			robotStartLocation--;
			wait1Msec(400);
		}
		// Keep AutoActions within a range of valid values
		if (robotStartLocation > 2) robotStartLocation = 2;
		if (robotStartLocation < 0) robotStartLocation = 0;
		//-------------------------------------------------
		switch (robotStartLocation)
		{
		case 0: nxtDisplayCenteredTextLine(6, "Left Wall");break;
		case 1: nxtDisplayCenteredTextLine(6, "Corner");break;
		case 2: nxtDisplayCenteredTextLine(6, "Right Wall");break;
		case 3: nxtDisplayCenteredTextLine(6, "Under Rack");break;
		default: nxtDisplayCenteredTextLine(6, "Error");break;
		}
		//---------------------------------------------------------------
		if(nNxtButtonPressed == 3)	// NXT Orange Button
		{
			wait1Msec(400);
			break;
		}
		//---------------------------------------------------------------
	}
}
开发者ID:Team5454,项目名称:RingItUp2012-2013,代码行数:46,代码来源:Auto-V3-3.c

示例8: main

task main() {
  int raw = 0;
  int nrm = 0;
  bool active = true;
  LSsetActive(LEGOLS);

  nNxtButtonTask  = -2;

  eraseDisplay();
  nxtDisplayTextLine(0, "Light Sensor");
  nxtDisplayTextLine(2, "Press orange");
  nxtDisplayTextLine(3, "button to switch");

  while (true) {
    // The enter button has been pressed, switch
    // to the other mode
    if (nNxtButtonPressed == kEnterButton) {
      active = !active;
      if (!active)
        // Turn the light off
        LSsetInactive(LEGOLS);
      else
        // Turn the light on
        LSsetActive(LEGOLS);

      // wait 500ms to debounce the switch
      wait1Msec(500);
    }

    nxtDisplayClearTextLine(5);
    nxtDisplayClearTextLine(6);

    // Get the raw value from the sensor
    raw = LSvalRaw(LEGOLS);

    // Get the normalised value from the sensor
    nrm = LSvalNorm(LEGOLS);

    nxtDisplayTextLine(5, "Raw:  %4d", raw);
    nxtDisplayTextLine(6, "Norm: %4d", nrm);
    wait1Msec(50);
  }
}
开发者ID:team3344,项目名称:FTC2011,代码行数:43,代码来源:LEGOLS-test1.c

示例9: main

task main () {
  int _dir = 0;
	int dcS1, dcS2, dcS3, dcS4, dcS5 = 0;

  nxtDisplayCenteredTextLine(0, "HiTechnic");
  nxtDisplayCenteredBigTextLine(1, "IR Seekr");
  nxtDisplayCenteredTextLine(3, "Test 1");
  nxtDisplayCenteredTextLine(5, "This is for the");
  nxtDisplayCenteredTextLine(6, "v1 seeker");
  wait1Msec(2000);

  while(true) {
    eraseDisplay();

    // read all of the sensors' values at once,
    // exit the app if an error occurs
    if (! HTIRSreadAllStrength(HTIRS, dcS1, dcS2, dcS3, dcS4, dcS5)) {
      nxtDisplayTextLine(4, "ERROR!!");
      wait1Msec(2000);
      StopAllTasks();
    }

    // read the direction from which the signal is coming,
    // exit the app if an error occurs
    _dir = HTIRSreadDir(HTIRS);
    if (_dir < 0) {
      nxtDisplayTextLine(4, "ERROR!!");
      wait1Msec(2000);
      StopAllTasks();
    }

    // display the info from the sensor
    nxtDisplayTextLine(0,"HT IR Seeker");
    nxtDisplayTextLine(2, "dir: %2d", _dir);
    nxtDisplayTextLine(3, "S1: %3d", dcS1);
    nxtDisplayTextLine(4, "S2: %3d", dcS2);
    nxtDisplayTextLine(5, "S3: %3d", dcS3);
    nxtDisplayTextLine(6, "S4: %3d", dcS4);
    nxtDisplayTextLine(7, "S5: %3d", dcS5);
    wait10Msec(100);
  }
}
开发者ID:EastsidePreparatorySchool,项目名称:EPSilonBlue,代码行数:42,代码来源:hitechnic-irseeker-v1-test1.c

示例10: selectRow

////////////////////////////////////////////////////////////////////////////////
//Select Row------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////////////
void selectRow()
{
	eraseDisplay();
	// Enable Top Line NXT Display (Bluetooth, NXT Name & Battery Status)
	//bNxtLCDStatusDisplay = true;
	while(true)
	{
		nxtDisplayCenteredTextLine(1,"DITU SAYS WEAR");
		nxtDisplayCenteredTextLine(2,"SAFETY GLASSES");
		nxtDisplayCenteredTextLine(4,"Peg Row:");
		//------------------------------------------------
		if(nNxtButtonPressed == 1)	// NXT Right Triangle Button
		{
			Row++;
			wait1Msec(400);
		}
		//-------------------------------------------------
		if(nNxtButtonPressed == 2)	// NXT Left Triangle Button
		{
			Row--;
			wait1Msec(400);
		}
		//---------------------------------------------------------------
		// Keep Row within a range of valid values
		if (Row > 2) Row = 2;
		if (Row < 0) Row = 0;
		switch (Row)
		{
		case 0: nxtDisplayCenteredTextLine(6, "Bottom Row");break;
		case 1: nxtDisplayCenteredTextLine(6, "Middle Row");break;
		case 2: nxtDisplayCenteredTextLine(6, "Top Row");break;
		default: nxtDisplayCenteredTextLine(6, "Error");break;
		}
		//---------------------------------------------------------------
		if(nNxtButtonPressed == 3)	// NXT Orange Button
		{																																				////////////////	You  need to return a variable
			wait1Msec(400);																										////////////////	that selects the auto program
			break;																																////////////////	for later. 			-Jos :)
		}
		//---------------------------------------------------------------
	}
}
开发者ID:Team5454,项目名称:RingItUp2012-2013,代码行数:45,代码来源:Auto-V1-5-2+(4).c

示例11: main

task main() {
  nxtDisplayCenteredTextLine(0, "Lego");
  nxtDisplayCenteredBigTextLine(1, "TOUCH");
  nxtDisplayCenteredTextLine(3, "SMUX Test");
  nxtDisplayCenteredTextLine(5, "Connect SMUX to");
  nxtDisplayCenteredTextLine(6, "S1 and sensor to");
  nxtDisplayCenteredTextLine(7, "SMUX Port 1");
  wait1Msec(2000);

  eraseDisplay();

  while (true) {
    // Check if the sensor is pressed or not.
    if (TSreadState(LEGOTOUCH))
      nxtDisplayCenteredBigTextLine(3, "ACTIVE");
    else
      nxtDisplayCenteredBigTextLine(3, "INACTIVE");
    wait1Msec(50);
  }
}
开发者ID:lasarobotics,项目名称:FTC4290-2014-Library,代码行数:20,代码来源:lego-touch-SMUX-test1.c

示例12: position

void position(){
	nxtDisplayTextLine(1, "L_ARROW = ARM FRIST");
	nxtDisplayTextLine(2, "R_ARROW = HAND FIRST");
	nxtDisplayTextLine(5, "WHICH SIDE?");
	bool select = false;
	while(!select){
		if(nNxtButtonPressed == 2){         //Left orange is button 2
			wait10Msec(50);
			r = -1;
			select = true;
			}else if(nNxtButtonPressed == 1){    // Right orange is button 1
			wait10Msec(50);
			r = +1;
			select = true;
		}
	}
	wait10Msec(100);
	eraseDisplay();
	nxtDisplayCenteredBigTextLine(4, "READY!");
}
开发者ID:journeys-FTC,项目名称:ring-it-up,代码行数:20,代码来源:U-Hand_Auto_Jan_24.c

示例13: displayArrow

/**
 * This displays an arrow on the screen pointing downwards.
 * @param degreesFromDown the number of degrees from down
 */
void displayArrow(int degreesFromDown)
{
   eraseDisplay();
   // Otherwise, the arrow would point up.
   degreesFromDown = degreesFromDown-180;

   //If you don't know trigonometry, you can ignore this part
   nxtDrawLine(49,
               31,
               (cosDegrees(degreesFromDown     ) * 20) + 49,
               (sinDegrees(degreesFromDown     ) * 20) + 31);
   nxtDrawLine((cosDegrees(degreesFromDown - 20) * 15) + 49,
               (sinDegrees(degreesFromDown - 20) * 15) + 31,
               (cosDegrees(degreesFromDown     ) * 20) + 49,
               (sinDegrees(degreesFromDown     ) * 20) + 31);
   nxtDrawLine((cosDegrees(degreesFromDown + 20) * 15) + 49,
               (sinDegrees(degreesFromDown + 20) * 15) + 31,
               (cosDegrees(degreesFromDown     ) * 20) + 49,
               (sinDegrees(degreesFromDown     ) * 20) + 31);
}
开发者ID:SwerveRobotics,项目名称:ftcrobotc,代码行数:24,代码来源:dexterind-imu-test3.c

示例14: main

task main () {
  string w_string = "MindstormsNXT";
  string r_string;
  tByteArray data;

  memcpy(data, w_string, sizeof(w_string));
  EEPROMwriteBytes(EEPROM, 0, data, 13);
  // After a write, you *must* wait 5 msec
  sleep(5);

  eraseDisplay();
  memset(data, 0, sizeof(tByteArray));
  EEPROMreadBytes(EEPROM, 0, data, 13);
  // Make sure the string is 0 terminated.
  data[13] = 0;
  StringFromChars(r_string, &data[0]);

  displayTextLine(1, "%s", r_string);
  sleep(2000);
}
开发者ID:botbenchtutorial,项目名称:robotcdriversuite,代码行数:20,代码来源:eeprom-test1.c

示例15: main

task main()
{
    done = false;

	eraseDisplay();

    nMotorEncoder[driveRight] = 0;
    nMotorEncoder[driveLeft] = 0;

	HTMCstartCal(HTMC);
	StartTask(rotate);

    while (!done) {
        nxtDisplayTextLine(2, "Right: %d", nMotorEncoder[driveRight]);
        nxtDisplayTextLine(3, "Left:  %d", nMotorEncoder[driveLeft]);
    }
	HTMCstopCal(HTMC);

    while (true) {}
}
开发者ID:LindaKhalaf25,项目名称:RNRR_6.00,代码行数:20,代码来源:calibrateCompass.c


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