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
// Create a data stream at data.sparkfun.com, then enter your keys here: | |
local publicKey = "xx" // enter public key here | |
local privateKey = "xx" // enter private key here | |
data_array <- array(800,[0,0,0,0]) | |
total <- 0 | |
conversion <- 4.95/476 | |
local req = http.get("https://data.sparkfun.com/output/"+o_publicKey+"/latest.json"); |
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
// | |
// SoftwareWire.cpp | |
// Library C++ code | |
// ---------------------------------- | |
// Developed with embedXcode | |
// http://embedXcode.weebly.com | |
// | |
// Project embed1 | |
// | |
// Created by Rei VILO, mars 29, 2013 09:59 |
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
#include "Energia.h" | |
#include "I2C_SoftwareLibrary.h" | |
#define LED RED_LED | |
#define SCL_PIN P2_6 ///< pin for SCL | |
#define SDA_PIN P2_7 ///< pin for SDA | |
SoftwareWire Wire(SDA_PIN, SCL_PIN); | |
#define _address 0x40 | |
uint8_t id[8]; |
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
// Define the Sensor Address | |
const ADDR = 0x1C; | |
// Define register map | |
const DR_STATUS = "\x00"; | |
const OUT_X_MSB = "\x01"; | |
const OUT_X_LSB = "\x02"; | |
const OUT_Y_MSB = "\x03"; | |
const OUT_Y_LSB = "\x04"; | |
const OUT_Z_MSB = "\x05"; |
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
local rh = read_reg(0x40,0xE5,true) | |
local t = read_reg(0x40,0xE0,false) | |
rh = string.byte(rh,1)*256+string.byte(rh,2) | |
t = string.byte(t,1)*256+string.byte(t,2) | |
t=(17572*t)/65536-4685 | |
t=tostring(t*18+32000) | |
rh=tostring(rh*12500/65536-600) | |
t=t:sub(1,t:len()-3).."."..t:sub(t:len()-2,t:len()) | |
rh=rh:sub(1,rh:len()-2).."."..rh:sub(rh:len()-1,rh:len()) | |
print(t.." : "..rh) |
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
// Create a data stream at data.sparkfun.com, then enter your keys here: | |
local publicKey = "x" | |
local privateKey = "x" | |
data_array <- array(800,[0,0,0,0]) | |
name_array <- ["x","y","z"] | |
total <- 0 | |
local req = http.get("https://data.sparkfun.com/output/"+publicKey+"/latest.json"); | |
local response = req.sendsync() |
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
stream.js:94 | |
throw er; // Unhandled stream error in pipe. | |
^ | |
Error: Unexpected "x" at position 3 in state START | |
at Parser.proto.charError (/Users/lgbeno/Documents/node/phant_development/node_modules/phant-manager-sparkfun/node_modules/npm-package-search/node_modules/npm-package-sync/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js:84:16) |
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
#include <RF75.h> | |
#include <SPI.h> | |
#define PIN_MOSI P1_7 | |
#define PIN_MISO P1_6 | |
#define PIN_CLK P1_5 | |
#define PIN_CE P3_5 | |
#define PIN_nCS P3_6 | |
#define PIN_IRQ P2_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
#include <analog_io.h> | |
#include <SPI.h> | |
analog_io radio(P3_5, P3_6, P2_5); | |
float ref, I; | |
float Current; | |
uint16_t batt,lp_ref; | |
const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; |
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
--------------------------------------------------------------------------- | |
ImportError Traceback (most recent call last) | |
<ipython-input-1-4ab7ec3413a5> in <module>() | |
----> 1 get_ipython().magic('pylab') | |
/root/anaconda3/lib/python3.4/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s) | |
2334 magic_name, _, magic_arg_s = arg_s.partition(' ') | |
2335 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC) | |
-> 2336 return self.run_line_magic(magic_name, magic_arg_s) | |
2337 |
OlderNewer