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
Once zsh is selected as the default terminal shell: | |
$ brew update | |
$ brew install nvm | |
$ mkdir ~/.nvm (if not already existing) | |
Then add the following in your ~/.zshrc: | |
export NVM_DIR="$HOME/.nvm" | |
source $(brew --prefix nvm)/nvm.sh |
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
// I used "Generic Board + WiFi" for my Blynk Project Device Settings | |
// I added one button setup as a switch mapped to V1 (Blynk Virtual Pin 1) that outputs 0 or 1 to toggle one of the on board LEDs | |
// I added another button setup as a push button mapped to V0 (Blynk Virtual Pin 0) that outputs 0 or 1 to toggle a Tessel relay | |
// I had to use --full option when loading the code on the T2 for the blynk-library to run properly | |
// Example Code Running on Tessel 2 | |
var tessel = require('tessel'); | |
var RelayLib = require('relay-mono'); |
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 bit_test(num, bit) { | |
return ((num >> bit) % 2 != 0) | |
} | |
function bit_set(num, bit) { | |
return num | 1 << bit; | |
} | |
function bit_clear(num, bit) { | |
return num & ~(1 << bit); |
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
// #tessel run pins.js T1 or #t2 run pins.js T2 | |
var tesselHardware = process.argv[2] || 'T2'; | |
var tessel = require('tessel'); | |
var PORT_A, PORT_B; | |
if ( tesselHardware == 'T1' ) { | |
PORT_A = { |
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
var tessel = require('tessel'); | |
var led = require('tessel-led'); | |
var _ = require('underscore'); | |
// Setup the Relay module on Port A | |
var relaylib = require('relay-mono'); | |
var relay = relaylib.use(tessel.port['A']); | |
// Setup all switches & sensors to the GPIO | |
var gpio = tessel.port['GPIO']; |