H file issue - No such file or directory

Hello,
I am new to platformIO. I have been trying to load a file which has an H file but I don’t seem to find the correct way to include the H file in the project. I have tried to put it in the include and lib folder but this doesn’t work.
The file is this one found on GitHub:

I get the following error:

src\main.cpp:5:10: fatal error: waveforms.h: No such file or directory

also I am not exactly sure how to deal with the ini file. I am trying to upload the sketch on a esp-01 (I know it would to be able to work but I dont’ have the esp32 available at the moment and I just want to learn how to upload sketch with PIO. I have just made a mix of my original empty esp01 file with the one on github and it looks like this:

[env:esp01_1m]

platform = espressif8266

board = esp01_1m

framework = arduino

; Custom Serial Monitor port

monitor_port = /dev/cu.SLAB_USBtoUART

; Custom Serial Monitor speed (baud rate)

monitor_speed = 115200

lib_deps =

is this correct?
thanks in advance for any help

It should work when the waveforms.h file is placed in include/ or in src/.

Thanks!

After trying again it seems that the issue now is actually the code: the compiler does not recognize some identifiers used in the code:
‘portMUX_TYPE’
portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_ISR(&mux);
etc.etc
I have never seen these before and there is no reference to them in the H file.
I wander if this only works when I have esp32 selected as a board and not with ESP01?..

UPDATE:
I have now created another project using esp32 settings and I don’t get that error anymore. But I do get this error:

fatal error: pins_arduino.h: No such file or directory

I have the feeling that this is due to the fact the actual board is not connected. I’ll have to try again when I have an ESP32.

In fact, your project is for ESP32.

Besides changing the platform to espressif32, you must also change the board to an ESP32-based board, e.g. board = esp32dev.

TBH I don’t seem to have much luck with PIO…
I cannot even get the blink sketch to work with my ESP-01.
It works fine with the arduino IDE (sketch uploding ok and LED blinking) but not when uploading the sketch from PIO.
I get a “success” message when compiling and uploading, but the LED does not blink.

I have tried to add a few lines to the ini file (which I have pasted below) but no change:

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
upload_resetmethod = nodemcu
board_build.flash_mode = dout

Please show a screenshot from your ArduinoIDE Tools-Menu to find the right PIO settings.


@sivar2311 Thanks for your support
this is the working configuration. do you think I am missing something?

I guess your sketch is using LED_BUILTIN for digitalWrite to the LED.

The board esp01_1m leads to an adruino_pins.h where LED_BUILTIN is set to 1
But your ArduinoIDE setting for LED_BUILTIN is set to 2.

Adding the following lines to your platformio.ini should make your led blink:

build_flags =
  -DLED_BUILTIN=2

Do you really use an ESP-01 ?

@sivar2311 this works thank you !!!
Clearly, the revised code specifying the correct pin number also works. And yes I am using an ESP-01.

Now I am going to try and resolve the problem I originally posted but it’s good to see some progress :). I have received in the post an ESP32 S3 and an ESP32 C3 and I am trying to get my head round the way platformIO works. I will post an update when I get to the bottom of the above issue, if I do. :slightly_smiling_face:

To keep the things clear, please open a new topic for new question.

OK will do in future; apologies

1 Like