I’m using this board
(Actually I’m using V1.0 of that board)
When I compile the source with Arduino and launcht it from there it works fine.
When I take the same sourcecode to PlatformIO and compile it there, I don’t get errors, but the board does nothing. What coulde be going wrong?
Source: (only change is the added ‘#include <Arduino.h>’ line
//========================================================================
// Includes
//========================================================================
#include <Arduino.h>
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire( D4 );
DallasTemperature sensors( &oneWire );
void setup()
{
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// initialize Dallas
pinMode( D7, OUTPUT );
pinMode( D4, INPUT_PULLUP );
pinMode( D3, OUTPUT );
digitalWrite( D7, LOW );
digitalWrite( D3, HIGH );
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// initialize LED
pinMode( LED_BUILTIN, OUTPUT );
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Serial
Serial.begin( 115200 );
while( !Serial )
{
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop()
{
float temp;
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
sensors.requestTemperatures(); // Send the command to get temperature readings
temp = sensors.getTempCByIndex(0);
Serial.println(temp);
}
Here’s my platformio.ini file:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:beetle]
platform = espressif32
board = firebeetle32
framework = arduino
lib_deps =
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^6.20.1
paulstoffregen/OneWire@^2.3.7
milesburton/DallasTemperature@^3.11.0
Here are the settings for the project in Arduino