Uploading Error with ESP32

Hello everyone!

I have a quick question, I wanted to try out this program and it wont work. Every time i upload i get an error message: The terminal process “C:\Users\asche.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload’” terminated with exit code: 1.

Here’s the code:
main.cpp:

#include <Arduino.h>
#include <OneWire.h> 
#include <DallasTemperature.h>

const int INPUT_PIN = 23;

OneWire oneWire(INPUT_PIN);	

DallasTemperature sensors(&oneWire);

void setup(void)
{
  pinMode(INPUT_PIN , INPUT);
  sensors.begin();	// Start up the library
  Serial.begin(9600);
}

void loop(void)
{ 
  // Send the command to get temperatures
  sensors.requestTemperatures(); 

  //print the temperature in Celsius
  Serial.print("Temperature: ");
  Serial.print(sensors.getTempCByIndex(0));
  Serial.print((char)176);//shows degrees character
  Serial.print("C  |  ");
  
  //print the temperature in Fahrenheit
  Serial.print((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);
  Serial.print((char)176);//shows degrees character
  Serial.println("F");
  
  delay(500);
}

platformio.ini:

[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
lib_deps = 
 DallasTemperature 
 OneWire
upload_port = COM4

What are the error messages leading up to this line? This jsut says “It failed :frowning:.”

Thank you for your response :slight_smile: !

I actually found out what the error was, I just used the wrong port. For some reason worked COM7, even though my computer told me that I only have COM3 and COM4.