Giter VIP home page Giter VIP logo

Comments (1)

colinodell avatar colinodell commented on August 24, 2024

so that there is only ever one instance of any pin as they are remembered by the factory

That makes sense to me since only one instance of the physical pin exists anyway. I'm not yet convinced it's totally necessary (will have to think on this) but it certainly seems useful.

Might make it more difficult to switch a pin from an input to an output pin. Primary key would have to be number + direction rather than just number.

I honestly don't think this will be very common. If you really need a pin to read and write data at different times you should probably be using a protocol like I2C, SPI or 1 Wire which can coordinate that switching with the other component(s) you're wired up to. And I think Raspberry Pi handles those with kernel modules separate from GPIO (unconfirmed).

Because I personally wouldn't be switching pin modes in my projects, I don't have a strong preference on how it handles people creating input and output pin objects for a single physical pin - it can either allow it or throw a big exception for all I care :)

Memory and performance differences could be insignificant

I wouldn't be too worried about the memory footprint of the objects themselves, but could having so many streams cause performance issues? If so then I think a flyweight could definitely help there.

from gpio.

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.