Main Site Documentation

Shouldn't Gadgeteer Drivers be Singleton?


#1

Hello guys,
Since we all Gadgeteer drivers are expected to be loaded once, should they implement the singleton Pattern… especially since they reserve Sockets and pins?

at least doing that will allow us to reference the same driver instance from elsewhere…

What do you think?

Jay.


#2

Not all of them. You should be able to use multiple button modules, LED, etc. DaisyLink modules of same type.


#3

thinking about it now you are Right… wouldn’t work for those Multiple Modules situations…