Giter VIP home page Giter VIP logo

Comments (7)

mattetti avatar mattetti commented on August 11, 2024

I was wondering the same. Is there value in shutting down without closing?

from devices.

zankich avatar zankich commented on August 11, 2024

Shutdown puts the PiGlow into a "software shutdown" mode, but it does not sever the connection to the PiGlow. Most of the methods in the PiGlow package are mapped directly to their register functions according to the api specification.

from devices.

mattetti avatar mattetti commented on August 11, 2024

@zankich can you think of a good reason why someone would want to shutdown and not close the device? If you do, we should probably keep both methods, but either way, I think that we should always shutdown during closing tho, what do you think?

from devices.

zankich avatar zankich commented on August 11, 2024

@mattetti I can imagine a case where you want to set a persistent color on your PiGlow, but do not want to have a program running in the background. Some process may wake up and set the colors to a specific pattern and then exit, or if you have a more complex system a routine which opens a connection to the PiGlow and and then closes the connection when it's finished. If you sent the PiGlow a Shutdown, the lights would turn off.

from devices.

mattetti avatar mattetti commented on August 11, 2024

Hmm that's very interesting. That's a totally realistic use case IMHO and does justify the 2 methods. Maybe some documentation might clarify why there are two methods. After all both Burcu and I were surprised.

from devices.

zankich avatar zankich commented on August 11, 2024

Yeah the documentation could be clearer for sure. I took a first stab at it with my PR, but there is definitely room to improve.

from devices.

rakyll avatar rakyll commented on August 11, 2024

I can imagine a case where you want to set a persistent color on your PiGlow, but do not want to have a program running in the background.

You can close the file descriptor and it will keep using displaying the latest state. These devices are state machines, not going to stop working when you close the I2C connection through devfs.

from devices.

Related Issues (19)

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.