EasyManua.ls Logo

Quantum Data 881 - Page 564

Quantum Data 881
1144 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
186 Chapter 15 Script SDK
return true;
}
double test2 = sc.InputFloat( "Test Float:" );
printf("\nThe input of Test Float is: %f\n", test2);
// =========================================================
// Demonstration of QDLcd associated APIs, WaitForButtonPress()
// =========================================================
if (sc.Canceled()) {
return true;
}
sc.ClearLCD();
sc.Write(1, 1, "Test WaitForButtonPress()");
sc.Write(0, 3, "<-Yes4");
sc.Write(16, 3, "No->");
QDKeyId pressedKey = sc.WaitForKeyPress(5000);
if ( pressedKey == QD_KEY_LEFT_4 ) {
printf("\nUser pressed \"Yes\"\n");
}
else if ( pressedKey == QD_KEY_RIGHT_4 ) {
printf("\nUser pressed \"No\"\n");
}
else
{
printf("\nPressed Invalid Key\n");
}
// =========================================================
// Demonstration of GetUIntResponse()
// =========================================================
if (sc.Canceled()) {
return true;
}
sc.SetCmdName("DPTR?");
//sc.ClearScreen();
sc.Exec();
if (sc.Succeed()) {
printf("\nTest GetUIntResponse(): The return value of command
\"%s\" is %d\n", sc.GetCmdName(), sc.GetUIntResponse());
}
else
printf("\nCommand execution failed.\n");
// =========================================================
// Demonstration of GetIntResponse()
// =========================================================
if (sc.Canceled()) {
return true;
}
sc.SetCmdName("HRES?");
//sc.ClearScreen();
sc.Exec();
if (sc.Succeed()) {
printf("\nTest GetIntResponse(): The return value of command
\"%s\" is %d\n", sc.GetCmdName(), sc.GetIntResponse());
}

Table of Contents

Related product manuals