Skip to content

A simple library, that adds `std::cout`-like support for the Arduino (using the `<<`-operator).

License

Notifications You must be signed in to change notification settings

n1ghtrunner/Arduino-PrintStream

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Another Fork of Arduino-PrintStream

A simple library that adds std::cout-like support for the Arduino using the <<-operator. This fork has been made convenient for use with Arduino running on STM32 and ESP32 processors.

Example usage

#include <PrintStream.h>

void setup () 
{
    Serial.begin (115200);
    Serial << "Hello, World!" << endl;

    Serial << "Counting to 0xf in hexadecimal: "
           << hex << noleadingzeros << showbase;
    for (int index = 0; index < 0x10; index++)
    {
        Serial << index << ' ';
    }
    Serial << dec << endl;

    float voltage = analogRead (A0) * 3.3 / 4095.0;
    Serial << "The voltage on analog pin A0 is " << setprecision (3) 
           << voltage << " V." << endl;
}

void loop ()
{
}

Installation

Generic

Download the library as a ZIP file, and import it into the Arduino IDE as explained here.

Into a VSCode Project

Add the following lines to your project's platformio.ini file:

lib_deps =
    https://github.com/spluttflob/Arduino-PrintStream.git

About

A simple library, that adds `std::cout`-like support for the Arduino (using the `<<`-operator).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%