Arduino - How to Save an Int into EEPROM

Поделиться
HTML-код
  • Опубликовано: 6 июл 2024
  • Learn how to save an Int variable into the EEPROM of your Arduino. To do that you will need to split the integer into multiple bytes, and store each byte on a different address.
    👉 Complete Arduino Course for Beginners: 🔥 rbcknd.com/arduino-for-beginners 🔥
    ✅ Click Here for the Corresponding Written Tutorial - Store an Int into EEPROM: roboticsbackend.com/arduino-s...
    0:00 Intro
    0:40 How to store an Int into EEPROM
    2:07 Check how many bytes in a data type
    3:03 Write Int into EEPROM
    6:41 Read Int from EEPROM
    8:34 Test the code and recap
    9:41 Improve the EEPROM functions
    10:56 Outro
    👉 Get all my courses here 👉 rbcknd.com/all-courses
    Twitter: / roboticsbackend
    More Free Tutorials: roboticsbackend.com

Комментарии • 28

  • @amandaschulze5093
    @amandaschulze5093 2 года назад

    Man that's one awesome video. You explained that verry well and well understandable! Great video

  • @thanatlikitchontarn4923
    @thanatlikitchontarn4923 3 года назад +1

    easy to understand thank you for video

  • @Gocast2
    @Gocast2 2 года назад

    Great explanation! learnt a lot

  • @ElectroDevices-yi4mj
    @ElectroDevices-yi4mj Год назад

    Great Tutor ... 🔥🔥

  • @rafaelcosta6757
    @rafaelcosta6757 Год назад

    thank you, my friend, you saved my life :)

  • @nuwannx
    @nuwannx 11 месяцев назад

    Thank you soo much ❤

  • @johnalbu2319
    @johnalbu2319 2 года назад

    Thank You, Thank You

  • @Europayacht
    @Europayacht 2 года назад

    Merci beaucoup!
    .

  • @nikhiljoshi2769
    @nikhiljoshi2769 Год назад

    Superb

  • @manfredbogner9799
    @manfredbogner9799 29 дней назад

    Sehr gut

  • @men810
    @men810 2 года назад

    Toll
    Danke

  • @lobmati5998
    @lobmati5998 2 месяца назад

    How do I need to shift when I want to use longs and doubles?

  • @jhengineering3578
    @jhengineering3578 2 года назад

    Hi, thanks for explaining in depth, how to read and write to EEPROM by manually shifting the bits, without relaying on predefined arduino functions. I have a question if I could replicate the procedure and store 4 byte floats? Thank you.

    • @RoboticsBackEnd
      @RoboticsBackEnd  2 года назад +2

      Yes, for a 4 bytes number you just need a few more lines of code, but the procedure is exactly the same!
      Check out the end of this article where I explain how to store a 4 bytes (long) data type. You should be able to get inspiration from that to store a float. roboticsbackend.com/arduino-store-int-into-eeprom/

    • @jhengineering3578
      @jhengineering3578 2 года назад

      Thanks for the replay! I ended up storing the float by incrementing the address. I've tried to replicate the code by using the long data type example code, but I get this error saying " invalid operands of types 'float' and 'int' to binary 'operator>>' ".

    • @Flyingeagle4998
      @Flyingeagle4998 2 года назад

      @@jhengineering3578 Hi, how did you solve that error exactly? when you said storing the float by incrementing the address, do you mean you placed a for loop in there?

  • @alvinkuhutan2914
    @alvinkuhutan2914 2 года назад

    how to read and write a long integer in EEPROM?

  • @Reaching1
    @Reaching1 Год назад

    is there some example on how to alter your code in order to save and read more than 2 bytes? I need 4 bytes to save a big number. your example works really well, but I can't find out how to change the code to save and read 4 bytes instead of just 2

    • @RoboticsBackEnd
      @RoboticsBackEnd  Год назад +1

      Here you can find an example to store 4 bytes: roboticsbackend.com/arduino-store-int-into-eeprom/

  • @verlidesouza
    @verlidesouza Год назад +1

    If you can't store values over 32768 without it being negative, make sure you're using an unsigned integer!

  • @kimvuivoon4858
    @kimvuivoon4858 Год назад

    Nice video, May I know what is mean by address +1?

    • @RoboticsBackEnd
      @RoboticsBackEnd  Год назад

      "address + 1" means that if the current address is, let's say 178, then the "address + 1" will access the address 179

  • @imwhatim7259
    @imwhatim7259 Год назад

    What about float value

    • @RoboticsBackEnd
      @RoboticsBackEnd  Год назад

      A float is stored on more bytes than an int, so you'll have to split the number into more bytes.

  • @adrianjosol4712
    @adrianjosol4712 2 года назад

    Or just use the put() and get() functions