Comments (7)
I was wondering the same. Is there value in shutting down without closing?
from devices.
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.
@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.
@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.
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.
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.
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)
- Rename repo to devices? HOT 1
- Fix misleading message HOT 2
- Use Go in written language rather than Golang HOT 1
- grove/accel3xdigital support for interrupts
- grove/accel3xdigital: close i2c device when closing
- s/New/Open/ as the entry point into devices HOT 1
- dotstar: nothing works HOT 2
- dotstar: alpha offset is wrong
- dotstar/examples/helloworld: use /dev/devspi0.1 instead of /dev/spi0.1 HOT 1
- piglow: Setup needs to be done at Open HOT 8
- grove/accel3xdigital: remove signal handling from example
- i2c/grove/oled96x96: rename Oled96x96 to OLED96x96 HOT 1
- reorganize the device packages by manufacturers HOT 14
- Gophercon hacking! HOT 2
- Setup travis CI
- Pick devices to implement HOT 11
- grove/oled96x96: add support for bitmap drawing
- grove/oled96x96: add support for scrolling
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 devices.