Coder Social home page Coder Social logo

Comments (15)

RobTillaart avatar RobTillaart commented on September 27, 2024

Thanks for reporting the issue.
Have no computer nearby (phone only) to investigate.
Will get back as soon as I am operational again.

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

I think i found the solution myself, a float can't be written to an u_int32_t it has to be writtenand reading as an object.
it know looks like it is working.

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

Yes floats are not directly supported, writeObject() is the way. As float is a basic datatype it might be usefull to have a writeFloat(address, float) to simplify the usage. And a read too of course.

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

That could be nice, but with the use of writeobject and readbject it does the trick also.

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

@ageurtse
Working on a 0.4.3 release with writeFloat() and readFloat() support in the develop branch.
I encounter problems with build-ci which are under investigation so I will not merge soon.
But you are welcome to give the code a test drive (unit tests are OK).

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

would love to try it out from within esphome, but don't know how to load the develop branche so i could test it.
after i found the solution for that i try and report back.

esphome is based on platformio
currently i add i like this

tryed instate of 0.4.2 develop

 libraries:
    - "Wire"
    - "robtillaart/FRAM_I2C@^0.4.2"

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

https://github.com/RobTillaart/FRAM_I2C/tree/develop
Green code button ==> local tab ==> download zip

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

The develop branch is not located on platformio so think it will be beyond trivial.
(not familiar with esphome ==> need to plan some R&D time...

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

The develop branch is not located on platformio so think it will be beyond trivial. (not familiar with esphome ==> need to plan some R&D time...

if you are into home automation, you should realy look at esphome and homeassistant

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

managed to install the develop tree, reading and writing a float looks good to me.
only thing for me, a float is 32 bit, why do you check for the size ?
this is because if i write a value to the second position it is in my case on the 5th byte.

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

I use the sizeof() to minimize the "magic numbers"
The call sizeof(fliat) is self documenting so it provides the reader of the code the meaning of the parameter.

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

Realy would like to try but don’t now how to select the development enviroment from within esphome (platformio)

from fram_i2c.

ageurtse avatar ageurtse commented on September 27, 2024

I managed to load the library and it all run’s fine.

so i see no need to not push it to the master

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

Thanks for testing, will merge tomorrow,
Still I need to have my build-CI running 100% as that saves me a lot of time .

from fram_i2c.

RobTillaart avatar RobTillaart commented on September 27, 2024

@ageurtse

  • added writeDouble() and readDouble() to the develop branch. This is for the boards that support 8 byte doubles.
  • created a PR
  • escalated the bug in the build-ci to the "build team"

from fram_i2c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.