GY-63_MS5611/libraries/ANSI/examples/ansiDemo01/ansiDemo01.ino

101 lines
1.8 KiB
Arduino
Raw Normal View History

2021-01-29 06:31:58 -05:00
//
// FILE: ansiDemo01.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// URL: https://github.com/RobTillaart/ANSI
2021-10-18 10:35:48 -04:00
2021-01-29 06:31:58 -05:00
#include "ansi.h"
ANSI ansi(&Serial);
void setup()
{
Serial.begin(115200);
ansi.clearScreen();
2023-11-11 11:11:00 -05:00
ansi.println("Hello world");
2021-01-29 06:31:58 -05:00
ansi.bold();
ansi.println("Hello world");
ansi.blink();
ansi.println("Hello world");
2023-11-11 11:11:00 -05:00
ansi.blinkFast();
ansi.println("Hello world");
2021-01-29 06:31:58 -05:00
ansi.underline();
ansi.println("Hello world");
ansi.low();
ansi.println("Hello world");
ansi.reverse();
ansi.println("Hello world");
ansi.normal();
ansi.println("Hello world");
delay(1000);
ansi.clearScreen();
ansi.println("Hello world");
ansi.println("Hello world");
ansi.println("Hello world");
delay(1000);
ansi.clearScreen();
for (int i = 1; i < 25; i++)
{
2023-02-27 05:33:43 -05:00
ansi.gotoXY(2 * i, i);
2021-01-29 06:31:58 -05:00
ansi.println("Hello world");
delay(100);
}
delay(1000);
ansi.clearScreen();
// 4 bit color test
for (int color = 0; color < 16; ++color) {
ansi.foreground(color);
ansi.print("foreground");
ansi.normal();
ansi.background(color);
ansi.println("background");
ansi.normal();
}
delay(1000);
ansi.clearScreen();
for (int color = 0; color < 16; ++color) {
ansi.color(color, (color + 1) % 16);
ansi.println("foreground and background");
ansi.normal();
}
delay(1000);
ansi.clearScreen();
// 8 bit color test
ansi.foreground(ansi.rgb2color(180, 0, 158));
ansi.print("foreground");
ansi.normal();
ansi.background(ansi.rgb2color(180, 0, 158));
ansi.println("background");
ansi.normal();
ansi.foreground(ansi.grey2color(64));
ansi.print("foreground");
ansi.normal();
ansi.background(ansi.grey2color(64));
ansi.println("background");
ansi.normal();
delay(1000);
ansi.normal();
2021-10-18 10:35:48 -04:00
ansi.println("\ndone...");
2021-01-29 06:31:58 -05:00
}
2021-10-18 10:35:48 -04:00
2021-01-29 06:31:58 -05:00
void loop()
{
}
2021-12-13 10:45:59 -05:00
2023-02-27 05:33:43 -05:00
// -- END OF FILE --