You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get "Cannot convert 'String' to 'uint8_t {aka unsigned char}' in initialization"
I am verry confused with all the variable types in C. What variable type should I use and I need it to be compatible with "Preferences.h" like :
Therefore you'll want to use putBytes and getBytes like this:
// to save
preferences.putBytes("Probe01", &Probe01, 8);
// to load
DeviceAddress Probe01; // declare the array first!
preferences.getBytes("Probe01", &Probe01, 8);
I went another way and instead of using/storing addresses I used the sensors.getAddress() method
sensors.getAddress(Probe0, 0);
that lets me use a simple int value.
Working on it here : https://github.com/sansillusion/esp32GrowSystem
But thanks a lot for your help, I was almost there with my tests I was missing the 8 in :
preferences.getBytes("Probe01", &Probe01, 8);
Hardware:
Board: NodeMCU-32S
Core Installation/update date: today
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200
Description:
I would like to store Dallas temperature devices address in preferences (so I can manipulate them in web app)
I I try to use a String like so :
I get "Cannot convert 'String' to 'uint8_t {aka unsigned char}' in initialization"
I am verry confused with all the variable types in C. What variable type should I use and I need it to be compatible with "Preferences.h" like :
???
I am lost in all those variables types and the different way to use them any help would be welcome.
The text was updated successfully, but these errors were encountered: