I’m trying to go through a few books to learn Arduino programming and really like PlatformIO IDE but I keep running into issues with code that won’t work in PlatformIO but will work in the regular Arduino IDE. It’s a simple program that flashes the built in LED, when I build it i get an “error: ‘flash’ was not declared in this scope”.
Here’s the code:
// sketch 4-02
#include "Arduino.h"
int ledPin = 13;
int delayPeriod = 250;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
flash(20, delayPeriod);
delay(3000);
}
void flash(int numFlashes, int d)
{
for (int i = 0; i < numFlashes; i ++)
{
digitalWrite(ledPin, HIGH);
delay(d);
digitalWrite(ledPin, LOW);
delay(d);
}
}
Am I missing something super obvious? Thanks in advance for any help!