Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


Electric Imp Reference Code

Subscribe to updates I use reference

Statistics on reference

Number of watchers on Github 91
Number of open issues 8
Average time to close an issue about 2 months
Main language Squirrel
Average time to merge a PR 8 days
Open pull requests 3+
Closed pull requests 6+
Last commit over 2 years ago
Repo Created about 7 years ago
Repo Last Updated over 2 years ago
Size 2.96 MB
Organization / Authorelectricimp
Page Updated
Do you use reference? Leave a review!
View open issues (8)
View reference activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating reference for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Electric Imp Reference Library

The Electric Imp Reference Library contains classes to help you interface with external hardware, webservices, and accomplish a myriad of tasks!

We have split the Reference Library into 3 categories:

  • Utility - Agent and/or Device libraries to simplify tasks such as persistant storage, building APIs, managing connections, and more!
  • Hardware - Device libraries to simplify interfacing with external hardware, managing wifi connections, etc
  • Web Services - Agent libraries that wrap external APIs such as Twitter, Xively, etc


We welcome contributions to the Electric Imp Reference Library. If you would like to contribute, please read and follow the guidelines listed below:


If you are adding a new library, please include it in the parent folder's README.md file (agent, hardware, web services).

Library Structure

All libraries must have their own folder (matching the library name) that contains the following files:

  • README.md - Include a description of the library, the author, a hookup guide (if required), and sample usage.
  • libraryName.device.nut (if device code is required) - The device code.
  • libraryName.agent.nut (if agent code is required) - The agent code.
  • Example folder (optional) - An example (if required).

The libraryName.device|agent.nut should contain the classes/tables associated with the library, and a sample instantiation, if a more complete example (or sample appliation) is required, it should be contained in an Example folder, with a similar structure to the library.

Example Folder

If your library includes an example, please use the following structure:

  • README.md - Description of example, and a hookup guide (if required)
  • libraryName.example.device.nut (if device code is required) - The device code.
  • libraryName.example.agent.nut (if agent code is required) - The agent code.
  • Other files as required - HTML, etc.

Code Conventions

Please use the following cade conventions in your Squirrel:


  • All lines should be semi-colon terminated
    • e.g. server.log("hello world");

Naming Conventions

  • Constants should be ALLCAPS with underscores between words
    • e.g const MAX_SIZE = 12;
  • Class/Tables names should be UpperCamelCased
    • e.g. class ThisClass {
  • Instantiated classes should be lowerCamelCased
    • e.g. thisClass <- ThisClass();
  • Class/Table methods and properties should be lowerCamelCased
    • e.g. function publicMethod() {
  • Class/Table methods and properties that should not be externally referenced should be prefaced with an underscore
    • e.g. function _privateMethod() {

Digital Out Declarations

  • Digital out declarations should always use the seconds parameter (initial state)
    • e.g hardware.pin9.configure(DIGITAL_OUT, 0);

File Headers

Your code files should include the following:

  • Copyright notice
  • What license it falls under
  • Link to license
// Copyright (c) 2014 Electric Imp
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT


All code in this repository (unless otherwise specificed in the file) is licensed under the MIT License.

See LICENSE.md for more information.

reference open issues Ask a question     (View All Issues)
  • almost 5 years how to run the .nut files?
  • about 5 years Google maps reference needs update (possibly), Google location services deprecated?
  • about 5 years "Cookie" in imp003-playback example is an overloaded term, causes support confusion
  • over 5 years update utilities -> timer to support weekly schedules
reference open pull requests (View All Pulls)
  • Blocking dequeue during backoff delay. Cancel now pulls from the queue.
  • Added code for reading from a bh1750 light sensor
  • Add Impeeduino Library
reference questions on Stackoverflow (View All Questions)
  • Getting a Object reference not set to an instance of an object
  • Critical Sections and return value by reference in C++
  • adding column to nested R data.table by reference
  • sockets threads and null object reference
  • SDL_TTF : undefined reference to "TTF_INIT"
  • This code is returning: object reference not set to an instance of an object IDK Why
  • Passing C pointers by reference?
  • Showing Error :Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
  • I cannot figure out how to fix Improper Restriction of XML External Entity Reference ('XXE')
  • Can't get reference to existing Window in IE
  • ILMerge DLL: Assembly not merged in correctly, still listed as an external reference
  • Dealing with agents being deleted in a system where agents reference and pass messages to each other
  • asp.net MVC framework class reference
  • MVC4 Data Annotations Cannot perform runtime binding on a null reference
  • Exception Message = "Object reference not set to an instance of an object."
  • Why is it not enough to reference the Bootstrap css and js to use Bootstrap classes?
  • Dlib undefined reference to `png_set_longjmp_fn'
  • Deleting multiple objects in HABTM reference table
  • VBA circular reference error
  • Call by reference or value while swift using method in C++
  • Who to contact in order to restore the reference documentation of spring?
  • CloudKit - NSPredicate for finding all records that contain specified CKReference in a reference list
  • Trouble Deleting Firebase Reference When Using UITableViewCell
  • WCF with reference to external web service
  • How to get a HTML character reference list from an existing webfont
  • How to reference constructor of a sealed in Kotlin?
  • Why @Async annotation causes circular reference issue?
  • Reference an XAML Windows 8 app style sheet in a different assembly
  • Linking external library to project still gives undefined reference
  • linux cross compiling linker issue with undefined reference to `g_thread_init' and `org_freedesktop_DBus_request_name'
reference list of languages used
More projects by electricimp View all
Other projects in Squirrel
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark