Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

parameter does not work for metro (1 * 60 * 1000) ... metro (1.0 * 60 * 1000) works fine #4

@partyboarder

Description

@partyboarder

please try the following code:

# include // Include Metro library # define METROWITHDOT 1.0 // in minutes # define METROWITHOUTDOT 1 // in minutes

Metro metroHeartbeat = Metro(1000);

Metro metroWithDotDefine = Metro(METROWITHDOT * 60 * 1000); // works
Metro metroWithOutDotDefine = Metro(METROWITHOUTDOT * 60 * 1000); // does not work
Metro metroWithDot = Metro(1.0 * 60 * 1000); // works
Metro metroWithOutDot = Metro(1 * 60 * 1000); // does not work
Metro metro1MinuteWithDot = Metro (60000.0); // works
Metro metro1MinuteWithOutDot = Metro (60000); // works

int counter = 1;

void setup()
{
Serial.begin(9600);
}

void loop()
{
if (metroHeartbeat.check() == 1)
{
Serial.print("Heartbeat: ");
Serial.println(counter, DEC);
counter++;
}

if (metroWithDotDefine.check() == 1)
{
Serial.println("MetroWithDotDefine_____triggered");
}

if (metroWithOutDotDefine.check() == 1)
{
Serial.println("METROWITHOUTDOTDEFINE_TRIGGERED");
}

if (metroWithDot.check() == 1)
{
Serial.println("MetroWithDot___________triggered");
}

if (metroWithOutDot.check() == 1)
{
Serial.println("METROWITHOUTDOT________TRIGGERED");
}

if (metro1MinuteWithDot.check() == 1)
{
Serial.println("Metro1MinuteWithDot____triggered");
}

if (metro1MinuteWithOutDot.check() == 1)
{
Serial.println("Metro1MinuteWithOutDot_triggered");
}
}

i never see any serial printout in capital letters ;(

can you confirm?

Henning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions