Library sizeΒΆ

Comment Code snippet Program bytes Data bytes
no song
player.play(0);
986 1
no song
player.play_P(0);
962 1
song in RAM
player.play("Indiana:d=4,o=5,b=4000:e,8p,8f,8g,8p,1c6");
1026 41
song in PROGMEM
player.play_P(PSTR("Indiana:d=4,o=5,b=4000:e,8p,8f,8g,8p,1c6"));
1002 1

The maximum size is calculated as a difference:

Program1 = empty template + code snippet

Program2 = empty template

Maximum library size = Program1 size - Program2 size

Actual size can be lower. MCU=atmega168

Template:

#include <rtttl.h>

Rtttl player;

const int pinSpeaker = 13;

void setup()
{
    Serial.begin(9600);
    tone(5, 400); // to include tone lib

    snippet;

}

void loop()
{
}

Previous topic

Simulation

Next topic

Build tests

This Page