08-02-2025, 12:44 PM
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 21
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress addr;
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Starte Sensor-Test...");
delay(500);
sensors.begin();
delay(5000);
int count = sensors.getDeviceCount();
Serial.printf("Gefundene Sensoren: %d\n", count);
if (count == 0) {
Serial.println("Keine Sensoren gefunden.");
return;
}
for (int i = 0; i < count; i++) {
if (sensors.getAddress(addr, i)) {
Serial.print("Sensor-Adresse: ");
for (uint8_t j = 0; j < 8; j++) {
Serial.printf("%02X", addr[j]);
}
Serial.println();
} else {
Serial.printf("Sensor %d: Adresse nicht lesbar\n", i);
}
}
}
void loop() {
Serial.println("Starte Sensor-Test1...");
delay(5000);
}
This dos not work - why
; 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:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
monitor_speed = 115200
monitor_auto = yes
monitor_rts = 0
monitor_dtr = 0
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
# RECOMMENDED
# Accept new functionality in a backwards compatible manner and patches
;pstolarz/OneWireNg @ ^0.13.3
paulstoffregen/OneWire @ ^2.3.8
milesburton/DallasTemperature @ ^4.0.4
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 21
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress addr;
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Starte Sensor-Test...");
delay(500);
sensors.begin();
delay(5000);
int count = sensors.getDeviceCount();
Serial.printf("Gefundene Sensoren: %d\n", count);
if (count == 0) {
Serial.println("Keine Sensoren gefunden.");
return;
}
for (int i = 0; i < count; i++) {
if (sensors.getAddress(addr, i)) {
Serial.print("Sensor-Adresse: ");
for (uint8_t j = 0; j < 8; j++) {
Serial.printf("%02X", addr[j]);
}
Serial.println();
} else {
Serial.printf("Sensor %d: Adresse nicht lesbar\n", i);
}
}
}
void loop() {
Serial.println("Starte Sensor-Test1...");
delay(5000);
}
This dos not work - why
; 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:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
monitor_speed = 115200
monitor_auto = yes
monitor_rts = 0
monitor_dtr = 0
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
# RECOMMENDED
# Accept new functionality in a backwards compatible manner and patches
;pstolarz/OneWireNg @ ^0.13.3
paulstoffregen/OneWire @ ^2.3.8
milesburton/DallasTemperature @ ^4.0.4

