Working with Sleep in code?


#1

Is there a way to trigger a Blink to go into Sleep mode? I’m working on an idea for a “game select” system and would like one of the final selections turn all the Blinks off. (This would be especially useful when about to put the Blinks away, so that we don’t have to use the “Wake your Blink” scissors workaround if a button accidentally gets held inside the case.)

Is there a way to prevent a Blink from going into Sleep mode? During some games of Fracture we have noticed some Blinks turning off, and this is clearly because we haven’t pushed the buttons for some time. It’s not a BIG deal but if there was some way in code to “if (this happens) then (refresh the interval before sleep)”, it would be nice.


#2

Not yet… but soon!

  1. Do our best to ensure all contiguous Blinks fall asleep at the same time
  2. Hold for 6-9 seconds and release to send force sleep to neighboring Blinks or automatically send force sleep at 9+

Currently, the default sleep timeout is 10 minutes (which can feel long…) I have been thinking about making it shorter once we have item #1 implemented. Also the wake neighbors helps with this a lot, since waking Blinks is quite tedious at the moment.

The solution I am leaning towards on variable sleep times is that our default sleep time without any button presses will remain at 10 min, but perhaps a game can be designed to timeout earlier if you so choose to. Allowing it to be longer than 10 min feels problematic for all of the obvious battery life concerns. In a game like Fracture, a game can take place for 30 minutes or more… waking it 3 times with a single button press during that game play seems reasonable, especially if they all warn they are going to sleep and go to sleep together. Other games, such as Berry have a lot of button pressing, it feels reasonable that if Blinks timed out after 2-5 minutes of inactivity that it probably signals you are not actively playing and they can go to sleep.

All in all. These are great points, and you are absolutely right. Looking forward to having these features implemented as stated in the issues. And moreover, it will be fun to see your “game select” system. We try ours out with a quick mockup of the interaction first.


#3

Good ideas, both 1 and 2 would help a lot.

Any thoughts on whether ANY neighbor signal activity should affect this timeout even without buttons, sort of the opposite of isValueReceivedOnFaceExpired. Such as when a piece notices it has ‘moved’ and has a different number of neighbors (in Fracture)? Does that make sense? I did notice in DevKitDemo there was occasional odd behavior in direct sunlight so that is worth keeping in mind to test.

Thanks! This quick mockup is good stuff, it has nearly all of what I had in mind and helps me understand quite a few things I was overlooking. I’m not the best coder but enjoy modifying existing works. I see I’m not the first who thought of the menu mode, I hope kenj1 shares!


#4

Yes, this was the source of internal debate for a while, and I feel like I have been convinced that offering a way to prevent sleep without button actions could be playing with fire for battery life. You are correct that sunlight and other stray IR does affect the dev kit Blinks (significantly) and the commercial Blinks should be greatly improved with their shielding.

That said, I do like the idea that the games only go to sleep after game inactivity, for n minutes, this way Fracture doesn’t fall asleep during game play. We’ll try it out, and if we feel we are in danger of some battery catastrophe, we’ll play it safe, otherwise, great suggestion! Keep ‘em comin’ :slight_smile:


#5

Completely agree on needing a way to put the Blink to sleep via program. I also made this request awhile ago. I know they’re looking to implement it in their “menu” feature.