Hello! I have a problem that I have been trying to solve for half a day and have searched everything - it does not find the OneWire, DallasTemperature libraries. I have the code in Visual Studio Code, I installed the libraries in the Arduino IDE, and they are displayed there. I inserted the path to the libraries into the c_cpp_properties.json file:
{
"configurations": [
{
"name": "vscode_avr_c_properties",
"includePath": [
"${workspaceFolder}/**",
"/usr/lib/avr/include",
"/home/ubuntu/Arduino/libraries/**"
],
"defines": [
"__AVR_ATmega328P__"
],
"cStandard": "c11",
"intelliSenseMode": "gcc-x64",
"compilerPath": "avr-gcc"
}
],
"version": 4
}
I copied the path from the properties:
A screenshot of the error itself:
I'll also leave the code itself (I don't know if it works, since I can't even test it):
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
sensors.requestTemperatures(); // Send the command to get temperature readings
// print the first sensor temperature in Celsius
lcd.setCursor(0, 0);
lcd.print("Temp 1: ");
lcd.print(sensors.getTempCByIndex(0));
// print the second sensor temperature in Celsius
lcd.setCursor(0, 1);
lcd.print("Temp 2: ");
lcd.print(sensors.getTempCByIndex(1));
delay(2000); // Wait for 2 seconds before updating the temperature readings
}
If you need any more information, please write to me. I really hope for your help, I think there are people here who know or have encountered something like this. Thank you!