本文整理汇总了C++中eraseDisplay函数的典型用法代码示例。如果您正苦于以下问题:C++ eraseDisplay函数的具体用法?C++ eraseDisplay怎么用?C++ eraseDisplay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eraseDisplay函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: main
task main() {
calibrateLight();
calibrateCompass();
int found = FollowSegmentTilEnd();
motor[left] = 0;
motor[right] = 0;
eraseDisplay();
if(found == FOUND_NODE) {
nxtDisplayCenteredTextLine(3, "Segment end");
}
else if(found == FOUND_CAN) {
nxtDisplayCenteredTextLine(3, "Can Detected");
}
else if(FOUND_ERROR) {
nxtDisplayCenteredTextLine(3, "Error");
}
wait10Msec(1000);
}
开发者ID:alecebrooks,项目名称:860-robot-path-finding,代码行数:20,代码来源:c1b1.c
示例17: initializeRobot
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// initializeRobot
//
// Prior to the start of autonomous mode, you may want to perform some initialization on your robot.
// Things that might be performed during initialization include:
// 1. Move motors and servos to a preset position.
// 2. Some sensor types take a short while to reach stable values during which time it is best that
// robot is not moving. For example, gyro sensor needs a few seconds to obtain the background
// "bias" value.
//
// In many cases, you may not have to add any code to this function and it will remain "empty".
//
/////////////////////////////////////////////////////////////////////////////////////////////////////
void initializeRobot()
{
//Initialize the position of the servos that control our ring arm
servo[pivotLeft] = 0;
servo[pivotRight] = 255;
//By default the NXT display will show diagnostics. This line disables that so we can display what
//we want to
disableDiagnosticsDisplay();
eraseDisplay();
nxtDisplayCenteredTextLine(1, "Autonomous");
nxtDisplayTextLine(2, gRun); //Sets line 2 of the display to show what routine is currently selected
nNxtButtonTask = ButtonTask; //Starts up the button task defined above for selecting the auto routine
nNxtExitClicks = 2; //Normally the gray NXT button exits the program, but since we use the exit button
//to "back up", we reset the exit clicks to 2 so that a double click will exit the
//program
while (gReady < 5)
{
//Do nothing. This loop puts us in a wait mode while a team member selects the program,
//alliance color, and position of the robot, etc using the button task above
}
nxtDisplayCenteredTextLine(7, "READY"); //Selection is done so display ready on the screen
//Calibrate the gyro sensor while the robot is still
HTGYROstartCal(gyro);
wait1Msec(1000);
//In order to speed up the sensing of the IR beacon, we initialize the servo for the IR seeker based
//on which side the robot was placed on
if (strcmp(gSide, "left")== 0)
{
servo[IR] = 50;
}
else
{
servo[IR] = 175;
}
}
开发者ID:helenarobotics,项目名称:helena-robotics,代码行数:55,代码来源:Autonomous4133.c
示例18: main
task main()
{
int step = 0;
StopTask(displayDiagnostics);
eraseDisplay();
initializeRobot();
waitForStart(); // Wait for the beginning of autonomous phase.
nMotorEncoder[tower] = 0;
while (true)
{
GyroTask(g_Gyro);
nxtDisplayTextLine(5, "Step=%d", step);
switch (step)
{
//*****************************Drive Back Parking Zone*************************************
case 0:
// step 0: go forward.
SetDriveTarget(60.0);
step++;
break;
case 1:
// step 1: wait for drive to complete.
if (g_driveEnabled == false)
{
step++;
}
break;
}
ArmTask();
TurnTask();
DriveTask();
wait1Msec(10);
}
}
开发者ID:oiautomatons,项目名称:OIRobotCode,代码行数:41,代码来源:AutoDriveFo.c
示例19: configureWiFi
void configureWiFi(char *_ssid, char *_key)
{
short len;
RS485clearRead(); // Clear out the buffer and test TX/RX.
sleep(1000); // Must be run first!
DWIFIsetEcho(false); // Must be run first!
sleep(1000); // Must be run first!
RS485clearRead();
eraseDisplay();
DWIFIsetSWControl(); // Must be run first!
RS485clearRead();
DWIFIsetVerbose(false);
sleep(100);
RS485clearRead();
RS485read(RS485rxbuffer, len);
DWIFIsetSSID(_ssid);
DWIFIsetDHCP(true);
DWIFIsetWPAPSK(_ssid, _key);
sleep(20000);
DWIFIsaveConfig();
}
开发者ID:MOE365FTC,项目名称:robotcdriversuite,代码行数:21,代码来源:dexterind-wifi-config.c
示例20: main
task main(){
int x_val, y_val, z_val; // axis values
float x_fval, y_fval, z_fval; // axis values
nxtDisplayCenteredTextLine(0, "Mindsensors");
nxtDisplayCenteredBigTextLine(1, "IMU");
nxtDisplayCenteredTextLine(3, "Test 1");
nxtDisplayCenteredTextLine(5, "Connect sensor");
nxtDisplayCenteredTextLine(6, "to S1");
wait1Msec(2000);
eraseDisplay();
/*
* Range 1: Change Accelerometer Sensitivity to 2G and Gyro to 250 degrees/sec
* Range 2: Change Accelerometer Sensitivity to 4G and Gyro to 500 degrees/sec
* Range 3: Change Accelerometer Sensitivity to 8G and Gyro to 2000 degrees/sec
* Range 4: Change Accelerometer Sensitivity to 16G and Gyro to 2000 degrees/sec
*/
MSIMUsetRange(MSIMU, MSIMU_SENSITIVITY_RANGE_1);
while (true){
// Read the GYROSCOPE
MSIMUreadGyroAxes(MSIMU, x_fval, y_fval, z_fval);
nxtDisplayTextLine(1, "%.2f", x_fval);
nxtDisplayTextLine(2, "%.2f", y_fval);
nxtDisplayTextLine(3, "%.2f", z_fval);
// Read the accelerometer
MSIMUreadAccelAxes(MSIMU, x_val, y_val, z_val);
nxtDisplayTextLine(5, "%d", x_val);
nxtDisplayTextLine(6, "%d", y_val);
nxtDisplayTextLine(7, "%d", z_val);
wait1Msec(50);
}
}
开发者ID:FTC-7037,项目名称:rdpartyrobotcdr,代码行数:40,代码来源:mindsensors-imu-test1.c
注:本文中的eraseDisplay函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论