-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add csi() - add comma separated integers (#18)
- added **csi()** comma separated integers for readability e.g. 123,458,654 - update readme.md. - update examples
- Loading branch information
1 parent
2674505
commit 27c1fa6
Showing
18 changed files
with
377 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
examples/print_comma_separated_integers/print_comma_separated_integers.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// FILE: print_comma_separated_integers.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.0 | ||
// DATE: 2023-12-20 | ||
// PURPOSE: demo readability | ||
// URL: https://github.com/RobTillaart/printHelpers | ||
|
||
#include "Arduino.h" | ||
#include "printHelpers.h" | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
while (!Serial); | ||
Serial.println(__FILE__); | ||
Serial.print("PRINTHELPERS_VERSION: "); | ||
Serial.println(PRINTHELPERS_VERSION); | ||
|
||
Serial.println((int32_t)123456789); | ||
Serial.println(csi((int32_t)123456789)); | ||
Serial.println(csi((int32_t)-123456789)); | ||
Serial.println(csi((int32_t)12345678)); | ||
Serial.println(csi((uint32_t)1234567)); | ||
Serial.println(csi((int16_t)-12345)); | ||
Serial.println(csi((int16_t)1234)); | ||
Serial.println(csi((uint8_t)123)); | ||
Serial.println(csi((int8_t)12)); | ||
Serial.println(csi((int32_t)-1)); | ||
|
||
int64_t big = 123456789012345678; | ||
Serial.println(csi(big)); | ||
} | ||
|
||
void loop() | ||
{ | ||
uint64_t large = 0; | ||
for (int i = 0; i < 64; i++) | ||
{ | ||
large += random(2); | ||
large *= 2; | ||
} | ||
} | ||
|
||
// -- END OF FILE -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
Arduino UNO | ||
IDE 1.8.19 | ||
|
||
print_performance.ino | ||
D:\Rob\WORK\Arduino\libraries\printHelpers\examples\print_performance\print_performance.ino | ||
PRINTHELPERS_VERSION: 0.4.3 | ||
|
||
4 | ||
4 | ||
|
||
Mass moon M = 7.34767309E+20 | ||
Speed of light c = 2.99792458E+8 | ||
Print E = Mc^2 = 6.6037592413026551656653076E+37 | ||
|
||
|
||
|
||
print64 | ||
TIME: 22476 | ||
660375892052148224 | ||
|
||
SCI | ||
TIME: 9236 | ||
6.603759288787841E+17 | ||
|
||
ENG | ||
TIME: 7388 | ||
660.375976562500000E+15 | ||
|
||
dtostrf | ||
TIME: 2468 | ||
660375890000000000.000000000000000 | ||
|
||
dtostre | ||
TIME: 1452 | ||
6.6037589e+17 | ||
|
||
toBytes | ||
TIME: 1976 | ||
586.531 PB | ||
|
||
hex | ||
TIME: 1308 | ||
092A206000000000 | ||
|
||
bin | ||
TIME: 2464 | ||
0000100100101010001000000110000000000000000000000000000000000000 | ||
|
||
toRoman | ||
TIME: 89352 | ||
CMXCIX | ||
|
||
printInch | ||
TIME: 177312 | ||
999 0/16 | ||
|
||
printFeet | ||
TIME: 137448 | ||
999"0' | ||
|
||
CSI | ||
TIME: 3015752 | ||
1,234,567,890,987,654,321 | ||
1234567890987654321 | ||
|
||
done... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name=printHelpers | ||
version=0.4.2 | ||
version=0.4.3 | ||
author=Rob Tillaart <[email protected]> | ||
maintainer=Rob Tillaart <[email protected]> | ||
sentence=Arduino library to help formatting data for printing. 64 bit integers (base 10 and 16). Engineering and scientific notation. | ||
paragraph=Supports 64 bit integers (base 10 and 16). Engineering and scientific notation. toBytes() for KB MB, HEX and BIN, Roman numbers. Feet and inch. | ||
paragraph=Supports 64 bit integers (base 10 and 16). Engineering and scientific notation. toBytes() for KB MB, HEX and BIN, Roman numbers. Feet and inch. Comma separated integers. | ||
category=Other | ||
url=https://github.com/RobTillaart/printHelpers | ||
architectures=* | ||
|
Oops, something went wrong.