Code Monkey home page Code Monkey logo

Comments (5)

ddemidov avatar ddemidov commented on July 30, 2024

value is function taking integer argument - the number of the value to get. Is it not enough?

from ev3dev-lang.

rhempel avatar rhempel commented on July 30, 2024

Yes, it's enough - I was just wondering if we could add to the spec attribute names that resolve back to the valuen attributes.
For example, when we have the IR sensor in REMOTE mode, Channel 1 results are in the value0 attribute.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

Sorry for being silent on this. So what you propose is having both value(n) function and value0...value8 attributes?

from ev3dev-lang.

rhempel avatar rhempel commented on July 30, 2024

No, I think I'm ok with the change I made to the value() function that accepts the index of the value you want. Maybe with Python/Lua or languages that have optional parameters, the default is to return an iterable (ie list) of all values. But then the driver spec would need to be able to pass that information down to the common value() getter somehow.

from ev3dev-lang.

rhempel avatar rhempel commented on July 30, 2024

Closing issue, the value(n) syntax is working fine - if we want to return an array of all values (which might be useful for I2C sensors that have a lot of values, then it will be a separate issue.

from ev3dev-lang.

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.