Skip to content

clausvalca226/microbit-pxt-flashstorage

 
 

Repository files navigation

flashstorage

pins=github:bsiever/microbit-pxt-flashstorage

Allow persistent flash storage to be used from blocks.

Storage may be erased on reprogramming!!!

Getting the number of keys stored

flashstorage.size() : number

Returns the number of key/value pairs stored.

Set a key value pair

flashstorage.set(key : string,  value : string) : void

Sets the given key to the provided value.

Getting a value for a key

flashstorage.get(key : string) : string

If present, returns the value for the given key. Returns the empty string if the key is not present.

Returns the empty string if there is no value associated with the key (or if the value is actually the empty string)

Removing a key/value pair

flashstorage.remove(key : string) : void

If present, remove the given key and associated value.

Acknowledgements

Icon based on Font Awesome icon 0xE0B7 SVG.

<script src="https://makecode.com/gh-pages-embed.js"></script> <script>makeCodeRender("{{ site.makecode.home_url }}", "{{ site.github.owner_name }}/{{ site.github.repository_name }}");</script>

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 53.5%
  • C++ 44.1%
  • Makefile 2.4%