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