mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.3.2 PrintCharArray
This commit is contained in:
parent
135bb4c6b6
commit
ecf84c538b
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2021 Rob Tillaart
|
||||
Copyright (c) 2017-2022 Rob Tillaart
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: PrintCharArray.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.1
|
||||
// VERSION: 0.3.2
|
||||
// PURPOSE: Class that captures prints into a char array
|
||||
// DATE: 2017-12-07
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
@ -16,12 +16,13 @@
|
||||
// 0.3.1 2021-11-13 update Arduino-CI, readme.md
|
||||
// add conditional PRINTCHARARRAY_MAX_BUFFER_SIZE
|
||||
// add write(char * str, uint8_t length) Print interface.
|
||||
// 0.3.2 2021-12-24 update library.json, license, minor edits
|
||||
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
|
||||
#define PRINTCHARARRAY_VERSION (F("0.3.1"))
|
||||
#define PRINTCHARARRAY_VERSION (F("0.3.2"))
|
||||
|
||||
#ifndef PRINTCHARARRAY_MAX_BUFFER_SIZE
|
||||
#define PRINTCHARARRAY_MAX_BUFFER_SIZE 250
|
||||
|
@ -1,10 +1,8 @@
|
||||
//
|
||||
// FILE: printCharArray1.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.0
|
||||
// PURPOSE: demo
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
//
|
||||
|
||||
|
||||
#include "PrintCharArray.h"
|
||||
|
@ -1,10 +1,8 @@
|
||||
//
|
||||
// FILE: printCharArray2.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.0
|
||||
// PURPOSE: demo right alignment
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
//
|
||||
|
||||
|
||||
#include "PrintCharArray.h"
|
||||
|
@ -1,10 +1,8 @@
|
||||
//
|
||||
// FILE: printCharArray3.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.0
|
||||
// PURPOSE: demo with XML writer
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
//
|
||||
|
||||
|
||||
#include "PrintCharArray.h"
|
||||
|
@ -1,10 +1,8 @@
|
||||
//
|
||||
// FILE: printCharArray4.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.0
|
||||
// PURPOSE: demo it takes less time to send data out.
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
//
|
||||
|
||||
|
||||
#include "PrintCharArray.h"
|
||||
|
@ -1,10 +1,8 @@
|
||||
//
|
||||
// FILE: printCharArrayDynamicSize.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.0
|
||||
// PURPOSE: demo setting size of internal buffer
|
||||
// URL: https://github.com/RobTillaart/PrintCharArray
|
||||
//
|
||||
|
||||
|
||||
#include "PrintCharArray.h"
|
||||
|
@ -15,8 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/PrintCharArray.git"
|
||||
},
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*"
|
||||
"platforms": "*",
|
||||
"headers": "PrintCharArray.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=PrintCharArray
|
||||
version=0.3.1
|
||||
version=0.3.2
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Library to capture prints into a char array.
|
||||
|
@ -20,13 +20,15 @@ The internal buffer can be set in the constructor and has a minimum of 20 bytes
|
||||
a maximum of 250 bytes. Default size is 100 bytes.
|
||||
|
||||
Applications
|
||||
- buffer slowly generated data, and send it with minimum time between bytes
|
||||
use it e.g. for faster printing to SD card or Ethernet which can handle larger buffers.
|
||||
- Buffer slowly generated data, and send it with minimum time between bytes.
|
||||
Use it e.g. for faster printing to SD card or Ethernet which can handle larger buffers.
|
||||
- print to buffer to see how many chars the output will be.
|
||||
- use to prevent "display line overflow" (e.g. floats).
|
||||
- use to right align output (see examples).
|
||||
-
|
||||
|
||||
Related to https://github.com/RobTillaart/PrintSize and https://github.com/RobTillaart/PrintString.
|
||||
|
||||
|
||||
## Interface
|
||||
|
||||
@ -44,14 +46,16 @@ Recall that a char array must have a '\0' delimiter.
|
||||
|
||||
## Operation
|
||||
|
||||
See examples
|
||||
See examples.
|
||||
|
||||
|
||||
## Future
|
||||
|
||||
- testing
|
||||
- add examples
|
||||
- rename examples
|
||||
- examples
|
||||
- inject spaces in "middle align" example? possible?
|
||||
- rename some
|
||||
- add real live examples.
|
||||
- add functions like **repeat(char c)** to inject e.g. 7 spaces etc.
|
||||
- add error flag
|
||||
-
|
||||
|
@ -39,17 +39,23 @@
|
||||
|
||||
unittest_setup()
|
||||
{
|
||||
fprintf(stderr, "PRINTCHARARRAY_VERSION: %s\n", (char *) PRINTCHARARRAY_VERSION);
|
||||
}
|
||||
|
||||
|
||||
unittest_teardown()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
unittest(test_constants)
|
||||
{
|
||||
assertEqual(PRINTCHARARRAY_MAX_BUFFER_SIZE, 250);
|
||||
}
|
||||
|
||||
|
||||
unittest(test_constructor)
|
||||
{
|
||||
fprintf(stderr, "VERSION: %s\n", (char *) PRINTCHARARRAY_VERSION);
|
||||
|
||||
PrintCharArray ps(100);
|
||||
|
||||
assertEqual(100, ps.bufSize());
|
||||
|
Loading…
Reference in New Issue
Block a user