darf ich Euch um Hilfe bitten. Bin mehr Lego-Bauer als Coder, das ist wohl einer der Hauptgründe .
Leider schaffe ich es seit Freitag nicht, einen ESP32-V2-Code zu erstellen, der Werte auf eine SD-Card schreibt. SD-Card und ESP32 ist etwas anders als bei Arduino. Hardwaremäßig ist alles bereits fertig, der Beispielsketch schreibt auf die SD.
Compiler meckert ständig, wobei ich glaube, SIE liegt falsch...aber erklär ihr das mal...:o
Ziel ist es, Sensorwerte (float und int) und Datum(char) für einen Bienenstock für spätere Auswertungen in die nächste Zeile einer MicroSD zu schreiben (1xje Stunde). Die nachstehende Anleitung hat mir leider nicht weit genug geholfen. https://forum.arduino.cc/index.php?topic=621038.0
Hier der Code (Fehler hier: invalid use of non-lvalue array // ist nur ein Auszug der Fehler, hab viele Varianten versucht...)
der Versuch hier const char zu erzeugen mit werte.c_str() klappt nicht...
Nachstehend die kopierte Fehlermeldung.
Grüße, Danke im Voraus,
Pucki
Arduino: 1.8.12 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 115200, None"
H:\03_ESP32\01_Hardwarecode\05_SD\SD_Test_ESP32_2\SD_Test_ESP32_2.ino: In function 'void loop()':
SD_Test_ESP32_2:40:29: error: conversion from 'int' to 'String' is ambiguous
String strGesamtgewicht = Gesamtgewicht;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: candidate: String::String(const __FlashStringHelper*) <near match>
String(const __FlashStringHelper *str);
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:40:29: error: invalid conversion from 'int' to 'const __FlashStringHelper*' [-fpermissive]
String strGesamtgewicht = Gesamtgewicht;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: candidate: String::String(const char*) <near match>
String(const char *cstr = "");
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:40:29: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
String strGesamtgewicht = Gesamtgewicht;
^
SD_Test_ESP32_2:41:20: error: conversion from 'int' to 'String' is ambiguous
String strTemp = Temp;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: candidate: String::String(const __FlashStringHelper*) <near match>
String(const __FlashStringHelper *str);
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:41:20: error: invalid conversion from 'int' to 'const __FlashStringHelper*' [-fpermissive]
String strTemp = Temp;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: candidate: String::String(const char*) <near match>
String(const char *cstr = "");
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:41:20: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
String strTemp = Temp;
^
SD_Test_ESP32_2:42:18: error: conversion from 'int' to 'String' is ambiguous
String strLF = LF;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: candidate: String::String(const __FlashStringHelper*) <near match>
String(const __FlashStringHelper *str);
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:42:18: error: invalid conversion from 'int' to 'const __FlashStringHelper*' [-fpermissive]
String strLF = LF;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: candidate: String::String(const char*) <near match>
String(const char *cstr = "");
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:42:18: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
String strLF = LF;
^
SD_Test_ESP32_2:43:21: error: conversion from 'int' to 'String' is ambiguous
String strPress = Press;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: candidate: String::String(const __FlashStringHelper*) <near match>
String(const __FlashStringHelper *str);
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:59:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:43:21: error: invalid conversion from 'int' to 'const __FlashStringHelper*' [-fpermissive]
String strPress = Press;
^
In file included from C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146:0,
from sketch\SD_Test_ESP32_2.ino.cpp:1:
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: candidate: String::String(const char*) <near match>
String(const char *cstr = "");
^
C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:57:9: note: conversion of argument 1 would be ill-formed:
SD_Test_ESP32_2:43:21: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
String strPress = Press;
^
SD_Test_ESP32_2:44:19: error: conversion from 'float' to non-scalar type 'String' requested
String strvin = vin;
^
SD_Test_ESP32_2:48:100: error: no match for 'operator+=' (operand types are 'const char [2]' and 'String')
werte = strdatum += strGesamtgewicht += ";" += strTemp += ";" += strLF += ";" += strPress += ";" += strvin += "\r\n";
^
Mehrere Bibliotheken wurden für "SD.h" gefunden
Benutzt: C:\Users\MARS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SD
Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\SD
exit status 1
conversion from 'int' to 'String' is ambiguous
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.