Im having trouble calling a function within a function

Im having trouble trying to call a function within a function in this platformio project, Im getting a "Function was not declared in this scope error but i dont get why, can somebody help me out?

#include <Arduino.h>
#include "variables.h"

void refreshSpeed()
{
  if (newSpeed != oldSpeed)
  {
    stepper.enableOutputs();
    if (spinOrientation == 1)
    {
      newSpeed = -newSpeed;
    }
    if (spinOrientation == 0)
    {
      newSpeed = fabs(newSpeed);
    }
    stepper.setSpeed(newSpeed);
    oldSpeed = newSpeed;
    delay(3000);
    stepper.disableOutputs();
  }
}

void showTime()
{

  const String DAY_BOX = "t3.txt=";
  const String HOUR_BOX = "n6.val=";
  const String MINUTE_BOX = "n7.val=";

  refreshTime();

  sendNumber(hours, HOUR_BOX);
  sendNumber(minutes, MINUTE_BOX);

  switch (dow)
  {
  case 0:
    sendText("Lunes", DAY_BOX);
    break;
  case 1:
    sendText("Martes", DAY_BOX);
    break;
  case 2:
    sendText("Miercoles", DAY_BOX);
    break;
  case 3:
    sendText("Jueves", DAY_BOX);
    break;
  case 4:
    sendText("Viernes", DAY_BOX);
    break;
  case 5:
    sendText("Sabado", DAY_BOX);
    break;
  case 6:
    sendText("Domingo", DAY_BOX);
    break;
  default:
    sendText("Error", DAY_BOX);
    break;
  }
}

Can you copy and paste the actual error messages please.

Paste between three backticks, not single quotes, like this:

```
Error message
Error message
```

Thanks.

Cheers,
Norm.

1 Like