- Python 3
- Pip 3
$ brew install python3
// Sample code using MMA8452Q accelerometer | |
// Electric Imp Device Squirrel code | |
// License: | |
// This code is provided under the Creative Commons Attribution-ShareAlike 3.0 License | |
// http://creativecommons.org/licenses/by-sa/3.0/us/legalcode | |
// If you find bugs report to duppypro on github or @duppy #MMA8452Q on twitter | |
// If you find this useful, send a good word to @duppy #MMA8452Q | |
// Thanks to @jayrz for finding the first bug. | |
///////////////////////////////////////////////// |
<html> | |
<head> | |
<script src="https://cdn.firebase.com/v0/firebase.js"></script> | |
</head> | |
<body> | |
<ul id="chat-list"> | |
</ul> | |
<input type="text" id="msg"/> | |
<input type="button" id="send" value="Send"/> | |
<script> |
local greenState = 0; | |
local redState = 0; | |
device.on("setRed", function(data) { | |
redState = data; | |
}); | |
device.on("setGreen", function(data) { | |
greenState = data; | |
}); |
//Tutorial 1 Reading Electric imp April input from JQM web app | |
//Imp & Agent are written in squirrel-lang.org They should have a .NUT extension. | |
//but I've used .js so the editor will use colour highlighting. |