GY-63_MS5611/libraries/ANSI/examples/ansi_IO/ansi_IO.ino
2021-12-13 16:45:59 +01:00

75 lines
1.0 KiB
C++

//
// FILE: ansi_IO.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// DATE: 2021-10-18
// URL: https://github.com/RobTillaart/ANSI
// (c) : MIT
//
#include "ansi.h"
ANSI ansi(&Serial);
String user = "";
String password = "";
void setup()
{
Serial.begin(115200);
ansi.clearScreen();
ansi.print("ANSI_LIB_VERSION: ");
ansi.print(ANSI_LIB_VERSION);
ansi.gotoXY(4, 2);
ansi.print("Username: ");
char c = '\0';
while (c != '\r')
{
if (ansi.available() )
{
c = ansi.read();
if (c != '\r')
{
user += c;
ansi.print(c);
}
}
}
ansi.gotoXY(5, 2);
ansi.print("Password: ");
c = '\0';
while (c != '\r')
{
if (ansi.available() )
{
c = ansi.read();
if (c != '\r')
{
password += c;
ansi.print('.');
}
}
}
ansi.gotoXY(10, 2);
ansi.print(user);
ansi.print("\t\t");
ansi.print(password);
ansi.println("\ndone...");
}
void loop()
{
}
// -- END OF FILE --