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
// Node.js | |
var bleno = require('bleno'); | |
var MSG = { | |
LED_COLOR: 1, | |
MSG_NEXT: 2, | |
MSG_NOW: 3, | |
MSG_ALERT: 4, | |
MSG_INFO: 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 circlify(v, opts) { | |
var d = Math.sqrt(v[0]*v[0] + v[1]*v[1]); | |
d = 1 + ((opts.radius-d)*opts.circle / d); | |
v[0] *= d; | |
v[1] *= d; | |
} | |
function kochs(a,b,opts) { | |
if (opts.d>=3) return []; | |
opts.d++; |
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
Hello |
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
/* Copyright (c) 2015 Gordon Williams, Pur3 Ltd. See the file LICENSE for copying permission. */ | |
/* | |
Module for the ADS1015 4 channel ADC, single ended or differential read | |
``` | |
// single-ended ADC read - channel 0: | |
I2C1.setup({ scl : ..., sda: ...} ); | |
var ads = new ADS1X15(I2C1); | |
ads.setGain(256); // +/- 0.256V | |
ads.getADC(0, function(val) { |
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
// http://ece.uwaterloo.ca/~ece222/ARM/ARM7-TDMI-manual-pt3.pdf | |
function rlist_lr(value) { | |
var regs = value.split(","); | |
var vals = { r0:1,r1:2,r2:4,r3:8,r4:16,r5:32,r6:64,r7:128,lr:256 }; | |
var bits = 0; | |
for (var i in regs) { | |
var reg = regs[i].trim(); | |
if (!(reg in vals)) throw "Unknown register name "+reg; | |
bits |= vals[reg]; |
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
<html> | |
<body>Test</body> | |
</html> |
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
/*OpenJsCad*/ | |
// change me! | |
var holeDistance = 1; | |
var holeHeight = 0.5; | |
var bracket = | |
CSG.cube({ center: [0, 0, 0], radius : [1, 1, 0.1] }).union( | |
CSG.cube({ center: [0, 1, holeHeight/2 + 0.15], radius : [1, 0.1, holeHeight/2 + 0.25] })); | |
var holes = | |
CSG.cylinder({ start: [0, 0, -1], end: [0, 0, 1], radius: 0.4 }).union( |
NewerOlder