• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

extract single float values from a float array

Q&A Forum › Category: ESP32 › extract single float values from a float array
0 Vote Up Vote Down
Manfred Haefner asked 5 months ago

Hello,
i created an array of 4 float variables to store it in the NVS memory. I can save and read back this file using the preverences lib. So far it works fine.
But how can i extract the 4 float variables from the arreay ?
Thanks for your help !
Manfred
 

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 months ago

Hi.
I’m not sure that I understood your question.
Can you be a little more specific and share more details?
Regards,
Sara

0 Vote Up Vote Down
Manfred Haefner answered 5 months ago

Hi Sara, thanks for your assistance.
i’m trying to store and read back  a float array to the non volatile space of a ESP32 like this:
float testfloat[]{A,B,C,D}  // A-D = float variables
preferences.putFloat(“test”, test[]);     // save the float array
…….
testfloat[] = preferences(“test”, false);  // read back the float array
 
this seems to be not possible, because the preferences.h cannnot handle float arrays.
Ist there any other way, to save and read back  4 float variables in one turn, to make less as possible write cycles to the NVS memory space?
Thanks, Manfred

0 Vote Up Vote Down
Sara Santos Staff answered 5 months ago

Hi.
I don’t think so.
I think you need to store each value at a time.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.