2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: SHEX_demo.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
2021-12-28 05:19:54 -05:00
|
|
|
// PURPOSE: demo SHEX hex dump class
|
2021-01-29 06:31:58 -05:00
|
|
|
// DATE: 2020-05-24
|
2021-12-28 05:19:54 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
#include "SHEX.h"
|
|
|
|
|
2021-12-28 05:19:54 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println(__FILE__);
|
2022-05-28 05:28:52 -04:00
|
|
|
Serial.print("SHEX_LIB_VERSION: ");
|
|
|
|
Serial.println(SHEX_LIB_VERSION);
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
Serial.println("\nNORMAL\n");
|
|
|
|
for (int i = 0; i < 64; i++)
|
|
|
|
{
|
|
|
|
Serial.print(random(127));
|
|
|
|
Serial.print('\t');
|
|
|
|
if ((i % 16) == 0) Serial.println();
|
|
|
|
}
|
|
|
|
|
2022-05-31 11:39:54 -04:00
|
|
|
Serial.println("\n\nSHEX ASCII TEST");
|
2021-01-29 06:31:58 -05:00
|
|
|
SHEX shex(&Serial, 16);
|
2022-05-31 11:39:54 -04:00
|
|
|
shex.setCountDigits(5);
|
|
|
|
shex.print("abcdefghijklmnopqrstuvwxyz");
|
|
|
|
shex.restartOutput();
|
|
|
|
|
|
|
|
shex.print("abcdefghijklmnopqrstuv");
|
|
|
|
shex.restartOutput();
|
2021-01-29 06:31:58 -05:00
|
|
|
|
2022-05-31 11:39:54 -04:00
|
|
|
Serial.println("\n\nSHEX\n");
|
2021-01-29 06:31:58 -05:00
|
|
|
for (int i = 0; i < 300; i++)
|
|
|
|
{
|
|
|
|
char c = random(150);
|
|
|
|
shex.print(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
Serial.println("\n\nSHEX modified\n");
|
|
|
|
shex.setBytesPerLine(60);
|
|
|
|
shex.setSeparator('-');
|
2022-05-31 11:39:54 -04:00
|
|
|
shex.setCountDigits(0);
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
for (int i = 0; i < 600; i++)
|
|
|
|
{
|
|
|
|
char c = random(150);
|
|
|
|
shex.print(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
Serial.println("\n Done...\n");
|
|
|
|
}
|
|
|
|
|
2021-12-28 05:19:54 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-12-28 05:19:54 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
// -- END OF FILE --
|