-
Notifications
You must be signed in to change notification settings - Fork 10
Using Embedis
Within the Arduino IDE you can explore the Embedis examples under :
Files -> Examples -> Embedis
The Embedis command line interface (CLI) uses familiar SET/GET/DEL commands for storing, retriving, and deleting key-value pairs in the persistant memory stores. For example :
set mykey somevalue
+OK
get mykey
+somevalue
del mykey
:1
The different persistent memory stores are called "dictionaries", and you can query what dictionary types are available on your system with the DICTIONARIES command, for example:
DICTIONARIES
*3
+FRAM
+FLASH
+EEPROM
Would indicate that EEPROM, FLASH, and FRAM are available on that system. New "dictionaries", or persistent memory stores, are easily added to the Embedis server by adding a handler with READ, WRITE, and COMMIT methods to your sketch.
The "select" command is used to switch between different storage devices Different memory types are selected using their device name, for example:
select EEPROM
+OK free = 8190
Would select an internal EEPROM for storage, and inform you that it has 8190 bytes of storage remaining. The current version of Embedis supports a maximum of 64K Keys, and uses two bytes of the 8196 bytes of the EEPROM to indicate the key pointer (in this case, no or zero keys).
A list of keys can be retrieved using the KEYS command for the selected memory:
select EEPROM \n
+OK free = 8190 \n
keys
*0
In this case, we show zero keys, or an empty dictionary.
Embedis starts writing from the high memory address of the device, and writes "down" in addressing, from high to low memory addresses. The reason for this is to be able to coexist with other uses of the same EEPROM, such as the Device Tree information for the auto-configuration of Socks, Hats, Capes, and Shields.
Access to hardware resources are accomplished similarly using the READ and WRITE commands, for example:
HARDWARE
*4
+wifi
+vcc
+temp
+blte
READ VCC
+3.335
READ TEMP
+37.542
Several custom commands are shown in the Embedis examples for the Arduino, including pinMode, DigitalWrite, DigitalRead, and AnalogRead, allowing you to read sensors and toggle I/O pins directly from the Embedis Command Line Interface. For example, to toggle the BUILTIN LED ON and OFF on a typical Arduino board:
pinMode 13 OUTPUT
+OK
digitalWrite 13 HIGH
+OK
digitalWrite 13 LOW
+OK
Embedis is designed to be small, lightweight, efficient, and extensible.
The folks who make this project possible:
- PatternAgents, LLC
- David Turnbull
- Tom Moxon
Embedis and thingSoC are community supported, you can help by donating to support this work.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License Licensing CC BY-SA 4.0
It may be used for Educational, Personal, or Commercial Use, provided you keep these notices, attribution, and share-alike. When you apply these licenses to material you create, it meets the Freedom Defined definition of a "Free Cultural Work". Free cultural works are the ones that can be most readily used, shared,and remixed by others, and go furthest toward creating a commons of freely reusable materials.
All product and company names are trademarks™ or registered® trademarks of their respective holders.
Use of them does not imply any affiliation with or endorsement by them.
Use of promotional images or datasheets in support their products by kind permission. All specifications are subject to change without notice.
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.