Comments (1)
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)
- MCP23017 HOT 2
- State of output pins HOT 2
- Permissions are not set, pelase provide example HOT 4
- How to use PWM ? HOT 5
- PHP 7 HOT 2
- EDGE_RISING behaving like EDGE_BOTH
- Under New Management :D HOT 4
- php version not declared HOT 6
- Set direction in constructor? HOT 3
- Numbered release HOT 3
- Pin::getEdge/setEdge HOT 3
- Pins multiple times exported HOT 1
- Installation guide insufficient HOT 3
- Add static analyse like phpstan HOT 1
- Permission denied for /sys/class/gpio/export HOT 2
- I2C support
- Debouncing interrupts HOT 5
- Initial Interrupt HOT 1
- Should pins auto export? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpio.