31 void sampleCountBits ();
32 void sampleTimeMeasurement ();
33 void sampleFreeMemory ();
43 pwOut.
println(
"Hello! Let's explore some of PropWare's utility functions");
46 sampleTimeMeasurement();
52 void sampleTimeMeasurement () {
53 unsigned int start = CNT;
55 pwOut.
println(
"But how long does it take to send each of these messages?");
57 pwOut.
printf(
"Well that previous message took precisely %u microseconds.\n", timeInMicros);
60 void sampleCountBits () {
62 pwOut.
println(
"\n/*** Counting Bits in a Variable ***/");
63 pwOut.
printf(
"How many bits are set in 0x%02X?\n", bits);
67 void sampleFreeMemory () {
69 pwOut.
printf(
"The largest contiguous block of free memory is %u bytes\n",
static uint8_t count_bits(uint32_t par)
Count the number of set bits in a parameter.
const PropWare::Printer pwOut
Most common use of printing in PropWare applications (not thread safe; see PropWare::pwSyncOut for mu...
void printf(const char fmt[], const T first, const Targs...remaining) const
Similar in functionality to the C-standard function printf.
static size_t get_largest_free_block_size(const uint8_t precision=32)
Determine the size of the largest block of free memory.
static uint32_t measure_time_interval(const register uint32_t start)
Determine the number of microseconds passed since a starting point.
void println(const char string[]) const
Print a null-terminated string followed by a newline (' ')