-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Small user persistent data space #85
Comments
Although it is technically possible to implement something like this, it is not something we have on the roadmap right now. |
This is a use case... |
Here’s an alternative which will do what you want in another way: Just capture the stop button and turn the light off. The hub will look off, and yet it isn’t so you can save as much as you like in memory. With lights and motors off, the battery should last quite a while. And since your program is persistent, there isn’t much of a loss if the batteries do run out eventually. So now the feature request is really reduced to saving a tiny bit more battery. You tell us where that should sit on the priority list 😄 |
Hi @laurensvalk , For example, I would prefer to have the UARTDevice class first and the ability to communicate via Bluetooth without interrupting the process with the Input () as it is now. In any case, as "end user", when I have an idea for a new feature, I tell to you this idea. After this, are you that evaluate which priority (if any) assign to the idea 😄 |
But what about the alternative solution suggested above? Is there anything that cannot be done that way? |
It's a solution, of course. |
The ability to turn on/off the BLE radio could be another useful feature 😄 |
So it is just about power saving then 😄 We’ll probably look at that at some point. There are special low power states that preserve RAM. I’m teasing a little bit - the main take away is that sometimes a new feature might sound good but often there are existing alternatives that work nearly just as well if you look at the problem from a different angle. |
Another related use case: remember some states between consequtive runs of the same program. Such as:
Usage could look like this from pybricks.tools import ram_data
ram_data(b"1234")
data = ram_data()
print(data) # prints 1234 Since this is mostly for advanced users, this could be done fairly minimally with a single function for both saving and reading as shown above. Data could be written to and read from a finite, static Numeric data could be packed with |
A popular feature request is to be able to store some runtime data on the hub, such as the last-used speed of a train. This commit reserves some space for this purpose so we can avoid breaking user programs stored on (external) flash when we add a user API later. See pybricks/support#85
Among the users that have requested this over here, ~100 bytes seems to be enough, so we can start with 128 bytes on the Powered Up hubs. |
A popular feature request is to be able to store some runtime data on the hub, such as the last-used speed of a train. This commit reserves some space for this purpose so we can avoid breaking user programs stored on (external) flash when we add a user API later. See pybricks/support#85
This allows end-users to save small amounts of data on the hub. This is useful for settings like train speed or counters in great ball contraption modules. Fixes pybricks/support#85
This allows end-users to save small amounts of data on the hub. This is useful for settings like train speed or counters in great ball contraption modules. Fixes pybricks/support#85
There is a way to store very small data between session?
4 or 8 bytes, to save some values to reuse between a execution and another execution.
(For example, the speed value for a motor)
The text was updated successfully, but these errors were encountered: