ATtiny85 Serial-like debug interface for the Wokwi.com simulator.
Use this library to log debug information from your code while running ATtiny85 projects on the Wokwi Arduino Simulator. It provides an interface similar to the familiar Serial object.
You can keep it when running your code on a physical ATtiny85 chip, and the debug prints will simply be ignored without affecting the rest of your program.
- Include the library in your Sketch:
#include <TinyDebug.h>- Call
Debug.begin()in your setup() function:
void setup() {
Debug.begin();
}- Use
Debug.print()andDebug.println()to log debug messages. E.g.:
void loop() {
Debug.print(F("Hello world! Millis:"));
Debug.println(millis());
delay(1000);
}You can also read values from the debug interface using any of the Stream input functions such as read() and readStringUntil().
For a complete example, check out the demo project on wokwi.com.
The Debug interface about 30 bytes of SRAM and 150 bytes of Flash memory, depending on the methods that you use in your code. TinyDebug also provides a lightweight logging interface, which does not use any SRAM
and uses about 30 bytes of Flash: tdPrint() and tdPrintln(). The caveat is that you can only print c-style strings, i.e. char * strings.
Usage example:
#include <TinyDebug.h>
void setup() {
tdPrintln(F("I do not use any SRAM!"));
}
void loop() {
/* ... */
}Released under the MIT License. Copyright (C) 2021 Uri Shaked.