This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Matrix LED character set display by Tony Smith | |
// Based on code from LinkSprite: | |
// [http://linksprite.com/wiki/index.php5?title=LED_Matrix_Kit] | |
// Additional code copyright © Electric Imp, 2014 | |
// Maxim Integrated Max7219 Datasheet: | |
// [http://www.maximintegrated.com/datasheet/index.mvp/id/1339] | |
// Set the number of available characters in the character set | |
const alpha_count = 95; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Print light reading trigger URL | |
server.log("Sensor Agent URL: " + http.agenturl()); | |
// Define funtions | |
function requestHandler(request, response) | |
{ | |
// Handle an incoming web request for a reading | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Log the URLs we need | |
server.log("Print message x: " + http.agenturl() + "?message=x&inv=1"); | |
function requestHandler(request, response) | |
{ | |
try | |
{ | |
// check if the user sent 'print' as a query parameter | |
if ("inv" in request.query) device.send("ts.led.inverse", request.query.inv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ZX81 USB Keyboard for Leonardo | |
// (c) Dave Curran | |
// 2013-04-27 | |
// Modified with Function keys by Tony Smith | |
// 2014-02-15 | |
#define NUM_ROWS 8 | |
#define NUM_COLS 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function one_wire_reset() | |
{ | |
// Configure UART for 1-Wire RESET timing | |
ow.configure(9600, 8, PARITY_NONE, 1, NO_CTSRTS) | |
ow.write(0xF0) | |
ow.flush() | |
if (ow.read() == 0xF0) | |
{ | |
// UART RX will read TX if there's no device connected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function one_wire_reset() | |
{ | |
// Configure UART for 1-Wire RESET timing | |
ow.configure(9600, 8, PARITY_NONE, 1, NO_CTSRTS) | |
ow.write(0xF0) | |
ow.flush() | |
if (ow.read() == 0xF0) | |
{ | |
// UART RX will read TX if there's no device connected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nokia 5110 control code for the imp | |
// Adapted by Tony Smith from a variety of sources: | |
// http://playground.arduino.cc/Code/PCD8544 | |
// http://www.microsyl.com/index.php/2010/03/24/nokia-lcd-library/ | |
// Assign the control pins to global variables | |
PIN_RST <- hardware.pin9; | |
PIN_CE <- hardware.pin8; | |
PIN_DC <- hardware.pin7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ADXL345 Register Values | |
const DEVICE_ID = 0x00; // Device ID register | |
const POWER_CTL = 0x2D; // Power Control register | |
const DATA_FORMAT = 0x31; // Data storage format register | |
const DATAX0 = 0x32; //X-Axis Data 0 | |
const DATAX1 = 0x33; //X-Axis Data 1 | |
const DATAY0 = 0x34; //Y-Axis Data 0 | |
const DATAY1 = 0x35; //Y-Axis Data 1 | |
const DATAZ0 = 0x36; //Z-Axis Data 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MAX7219_Matrix | |
{ | |
// Squirrel class for 8 x 8 LED matrix displays driven by the MAX7219 controller | |
// For example: https://www.sparkfun.com/products/11861 | |
// Code by Tony Smith (@smittytone) May 2014 | |
// Version 1.0 | |
// Constants for MAX7219 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SSD1306_OLED | |
{ | |
// Squirrel Class for Solomon SSD1306 OLED controller chip | |
// [http://www.adafruit.com/datasheets/SSD1306.pdf] | |
// As used on the Adafruit SSD1306 I2C breakout board | |
// [http://www.adafruit.com/products/931] | |
// Bus: I2C | |
// Code by Tony Smith (@smittytone) June 2014 | |
// Version 1.0.2 |
OlderNewer