Skip to content

Commit

Permalink
Adding docs and examples for the LED pins
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianGenisio committed Apr 11, 2016
1 parent 35a12d6 commit 5436a4c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions eg/onboard-led.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// global.IS_TEST_ENV = true;
var Tessel = require("../lib/tessel.js");
var board = new Tessel();

board.on("ready", function() {
console.log("Ready");

var leds = ["L0", "L1", "L2", "L3"];

leds.forEach(function(pin) {
this.digitalWrite(pin, this.HIGH);
}.bind(this));

setTimeout(function() {
leds.forEach(function(pin) {
this.digitalWrite(pin, this.LOW);
}.bind(this));
}.bind(this), 1000);
});
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ board.on("ready", function() {
```

## Pin Naming Guide
There are two primary ports on the Tessel2: Port "A" and Port "B". There is also a bank of onboard LEDs which are controllable from a port we are calling "L". Note that "L0" and "L1" should be reserved for system functions (ERR and WLAN) so you should avoid using them. Instead, consider using "L2" and "L3" which are intended to be more informational in nature.

| Port | Number | Johnny-Five Compatible Name |
|------|--------|-----------------------------|
Expand All @@ -52,6 +53,10 @@ board.on("ready", function() {
|B|5|`"b5"` or `"B5"`|
|B|6|`"b6"` or `"B6"`|
|B|7|`"b7"` or `"B7"`|
|L|0|`"l0"` or `"L0"`|
|L|1|`"l1"` or `"L1"`|
|L|2|`"l2"` or `"L2"`|
|L|3|`"l3"` or `"L3"`|

See [examples](https://github.com/rwaldron/tessel-io/tree/master/eg) for basic, non-Johnny-Five examples.

Expand Down Expand Up @@ -80,6 +85,10 @@ See [examples](https://github.com/rwaldron/tessel-io/tree/master/eg) for basic,
|B | 5 || | | | | || || |
|B | 6 || | | | | | ||| |
|B | 7 || | | | | | | |||
|L | 0 | ✓ (out only)| | | | | | | | | |
|L | 1 | ✓ (out only)| | | | | | | | | |
|L | 2 | ✓ (out only)| | | | | | | | | |
|L | 3 | ✓ (out only)| | | | | | | | | |



Expand Down

0 comments on commit 5436a4c

Please sign in to comment.