├── .gitignore ├── .travis.yml ├── Gruntfile.coffee ├── README.md ├── TODO ├── package.json ├── plugins ├── toc │ └── toc.js └── verbose │ └── verbose.js └── src ├── assets ├── datasheets │ └── makerkit │ │ ├── buzzer.pdf │ │ ├── mini-dc-motor.pdf │ │ ├── photoresistor.pdf │ │ ├── rgb-led.pdf │ │ ├── thermistor.pdf │ │ ├── tilt-sensor.pdf │ │ └── vibration-motor.pdf ├── favicon.ico ├── fonts │ ├── Inconsolata.otf │ ├── ionicons.eot │ ├── ionicons.svg │ ├── ionicons.ttf │ └── ionicons.woff ├── images │ ├── .picasa.ini │ ├── .picasaoriginals │ │ ├── .picasa.ini │ │ ├── smart-config.png │ │ ├── spark-apps.png │ │ └── tinker-select.png │ ├── access-token.png │ ├── annotated-example1.jpg │ ├── breadboard-one-led.jpg │ ├── breadboard-temp-sensor.jpg │ ├── breadboard-two-leds.jpg │ ├── breathingCyan.gif │ ├── bshield-bottom.jpg │ ├── bshield-charging-powering.jpg │ ├── bshield-charging.jpg │ ├── bshield-powering.jpg │ ├── bshield-top.jpg │ ├── build-libraries.jpg │ ├── build-library-github.jpg │ ├── chip-ufl.jpg │ ├── choose-app-to-include-library.png │ ├── claim-a-core.png │ ├── coolterm-settings.png │ ├── coolterm-setup.png │ ├── core-bottom-view.jpg │ ├── core-buttons.jpg │ ├── core-cc3000.jpg │ ├── core-dim.jpg │ ├── core-flashchip.jpg │ ├── core-in-box.jpg │ ├── core-leds.jpg │ ├── core-pin-i2c.jpg │ ├── core-pin-spi.jpg │ ├── core-pin-usart.jpg │ ├── core-pins-jtag.jpg │ ├── core-power1.jpg │ ├── core-power2.jpg │ ├── core-regulator.jpg │ ├── core-rf-test-report.pdf │ ├── core-rf.jpg │ ├── core-s11-chart.png │ ├── core-stm32.jpg │ ├── core-top-view.jpg │ ├── core-usb.jpg │ ├── core-user-led.jpg │ ├── create-account.jpg │ ├── dashboard │ │ ├── logs-big-picture.png │ │ └── raw-event.jpg │ ├── device-id.jpg │ ├── find-the-right-library.png │ ├── flashingBlue.gif │ ├── flashingGreen.gif │ ├── flashingMagenta.gif │ ├── flashingRed.gif │ ├── fork-app.jpg │ ├── github-download.jpg │ ├── ide-compile-errors.jpg │ ├── ide-compile.jpg │ ├── ide-flash.jpg │ ├── ide-functions.gif │ ├── ide-get-variable.gif │ ├── ide-i-button.png │ ├── ide-include-library.jpg │ ├── ide-log-in.jpg │ ├── ide-mem-usage.png │ ├── ide-menu.jpg │ ├── ide-palette.jpg │ ├── ide-select-core.jpg │ ├── ide-selected-library.jpg │ ├── ide-serial-monitor.jpg │ ├── ide-toolbar-compile.jpg │ ├── ide-toolbar.jpg │ ├── ide-watch-variable.gif │ ├── ide-wifi-list.jpg │ ├── ide-wifi-save.jpg │ ├── ide-window.jpg │ ├── ide.png │ ├── import-library.png │ ├── jtag-bottomview.jpg │ ├── jtag-setup.jpg │ ├── jtag-topview.jpg │ ├── library-drawer.png │ ├── library-icon.png │ ├── log-in.jpg │ ├── managing-library.png │ ├── mk-10k-resistor.bmp │ ├── mk-1k-resistor.bmp │ ├── mk-330ohm-resistor.bmp │ ├── mk-buzzer.bmp │ ├── mk-ceramic-capacitor-100nF.bmp │ ├── mk-ceramic-capacitor-10nF.bmp │ ├── mk-core-in-box.bmp │ ├── mk-diode.bmp │ ├── mk-dpdt-switch.bmp │ ├── mk-electrolytic-capacitor.bmp │ ├── mk-force-sensor.bmp │ ├── mk-header-female.bmp │ ├── mk-header-male-dual.bmp │ ├── mk-header-male.bmp │ ├── mk-jumper-cables.bmp │ ├── mk-ldr.bmp │ ├── mk-led-3mm.bmp │ ├── mk-micro-rc-servo.bmp │ ├── mk-mini-dc-motor.bmp │ ├── mk-mini-pushbutton.bmp │ ├── mk-npn-transistor.bmp │ ├── mk-pcb.bmp │ ├── mk-potentiometer.bmp │ ├── mk-rgb-led.bmp │ ├── mk-shift-register.bmp │ ├── mk-temp-sensor.bmp │ ├── mk-thermistor.bmp │ ├── mk-tilt-sensor.bmp │ ├── mk-vibration-motor.bmp │ ├── publish-library.png │ ├── rc-car-jumpers-small.jpg │ ├── rc-car-motor-conn-small.jpg │ ├── rc-car-power-small.jpg │ ├── rc-car-top-small.jpg │ ├── relay-shield-bulb.jpg │ ├── relay-shield-setup.jpg │ ├── relay-shield-top.jpg │ ├── select-a-core.jpg │ ├── smart-config copy.png │ ├── smart-config.jpg │ ├── spark-app.jpg │ ├── spark-apps copy.png │ ├── spark-apps.jpg │ ├── spark-docs.png │ ├── spark-login-button.png │ ├── spark-login-modal.png │ ├── spark-pinout.png │ ├── sparklogo-2x.png │ ├── sparklogo.png │ ├── sshield-bottom.jpg │ ├── sshield-setup.jpg │ ├── sshield-top.jpg │ ├── tinker-select copy.png │ ├── tinker-select.jpg │ ├── tinker.png │ ├── using-library.png │ ├── validate-library.png │ ├── webhooks-librato-cli-example.png │ ├── webhooks-librato-metric-sample.png │ ├── webhooks-librato-metrics-screen.png │ ├── webhooks-librato-metrics-screen1.png │ └── webhooks_librato_example_1.png ├── js │ ├── animated-core.js │ ├── docs.js │ ├── jquery-1.11.1.min.js │ ├── jquery-styling.js │ ├── lang-apollo.js │ ├── lang-basic.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-dart.js │ ├── lang-erlang.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lisp.js │ ├── lang-llvm.js │ ├── lang-lua.js │ ├── lang-matlab.js │ ├── lang-ml.js │ ├── lang-mumps.js │ ├── lang-n.js │ ├── lang-pascal.js │ ├── lang-proto.js │ ├── lang-r.js │ ├── lang-rd.js │ ├── lang-scala.js │ ├── lang-sql.js │ ├── lang-tcl.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-yaml.js │ ├── prettify.js │ └── scrollspy.js └── orange.ico ├── content ├── api.md ├── build.md ├── cli.md ├── connect.md ├── dashboard.md ├── dev.md ├── examples.md ├── firmware.md ├── fr │ ├── connect.md │ └── start.md ├── hardware.md ├── ifttt.md ├── it │ ├── connect.md │ ├── examples.md │ └── start.md ├── javascript.md ├── oldstart.old ├── shields.md ├── start.md ├── tinker.md ├── troubleshooting.md ├── webhooks.md └── zh │ ├── connect.md │ ├── shields.md │ ├── start.md │ └── troubleshooting.md ├── layouts └── docs.hbs └── stylesheets ├── basics.less ├── colors.less ├── content.less ├── core.less ├── header.less ├── ionicons.less ├── menu.less ├── prettify.less ├── style.less └── vibrant.less /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | build/ 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '0.10' 4 | before_install: npm install -g grunt-cli 5 | script: grunt deploy 6 | deploy: 7 | provider: s3 8 | access_key_id: "AKIAJ5RMM3264VMARJQQ" 9 | secret_access_key: 10 | secure: "DoLLx5daVx4BGG60BeE1TFy0tZakIr20IQuQmqL/B9ruEORujnaELpgFlD2a5w/WwD5vi65U4tuZAv/M647vtjx65G4Xtt5hLcX1Ja32JL2Dg+5O4rrzImQM8S0z4cCRyZ7KjADaDYyubyeyOBKLB95reAi44ESgVNmbsPNF4yE=" 11 | bucket: docs.spark.io 12 | skip_cleanup: true 13 | local-dir: build 14 | on: 15 | repo: spark/docs 16 | branch: master 17 | -------------------------------------------------------------------------------- /Gruntfile.coffee: -------------------------------------------------------------------------------- 1 | ### 2 | # 3 | # The Gruntfile for the Spark documentation 4 | # Created by Zach Supalla 5 | # https://www.spark.io/ 6 | # 7 | # Use this gruntfile to: 8 | # - Assemble the static site (grunt build) 9 | # - Deploy locally for development (grunt server) 10 | # 11 | # Copyright (c) 2013 Spark Labs, Inc. 12 | # Licensed under a Creative Commons Attribution-Sharealike 3.0 License. 13 | # 14 | ### 15 | 16 | module.exports = (grunt) -> 17 | 18 | gruntConfig = 19 | 20 | config: 21 | src: 'src' 22 | dist: 'build' 23 | content: 'src/content' 24 | layouts: 'src/layouts' 25 | 26 | assemble: 27 | # ASSEMBLE!!! 28 | options: 29 | flatten: true 30 | assets: '<%= config.dist %>/assets' 31 | layoutdir: '<%= config.src %>/layouts' 32 | layout: 'default.hbs' 33 | plugins: ['assemble-contrib-permalinks', 'plugins/verbose/verbose.js', 34 | 'plugins/toc/toc.js'] 35 | permalinks: 36 | structure: ':basename/index:ext' 37 | toc: 38 | id: 'toc' 39 | docs: 40 | options: 41 | ext: '.html' 42 | layout: 'docs.hbs' 43 | files: [ 44 | { 45 | expand: true 46 | cwd: '<%= config.content %>' 47 | src: ['*.md'] 48 | dest: '<%= config.dist %>' 49 | } 50 | ] 51 | 52 | 53 | # 'gh-pages': 54 | 55 | clean: 56 | dest: ['<%= config.dist %>/**'] 57 | 58 | copy: 59 | start: 60 | dest: '<%= config.dist %>/index.html' 61 | src: '<%= config.dist %>/start/index.html' 62 | assets: 63 | expand: true 64 | dest: '<%= config.dist %>/assets/' 65 | cwd: '<%= config.src %>/assets/' 66 | src: '**' 67 | 68 | watch: 69 | content: 70 | files: ['<%= config.content %>/*.md', '<%= config.layouts %>/*.hbs'] 71 | tasks: ['build'] 72 | stylesheets: 73 | files: ['<%= config.src %>/stylesheets/*.less'] 74 | tasks: ['less'] 75 | assets: 76 | files: ['<%= config.src %>/assets/**'] 77 | tasks: ['copy'] 78 | livereload: 79 | options: 80 | livereload: '<%= connect.options.livereload %>' 81 | files: [ 82 | '<%= config.dist %>/{,*/}*.html', 83 | '<%= config.dist %>/assets/{,*/}*.css', 84 | '<%= config.dist %>/assets/{,*/}*.js', 85 | '<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' 86 | ] 87 | 88 | connect: 89 | options: 90 | port: 9000 91 | livereload: 35729 92 | hostname: 'localhost' 93 | livereload: 94 | options: 95 | open: true 96 | base: ['<%= config.dist %>'] 97 | 98 | coffeelint: 99 | grunt: ['Gruntfile.coffee'] 100 | 101 | less: 102 | docs: 103 | files: 104 | '<%= config.dist %>/assets/css/style.css': 105 | '<%= config.src %>/stylesheets/style.less' 106 | 107 | compress: 108 | main: 109 | options: 110 | archive: 'docs.zip' 111 | files: [{ 112 | expand: true 113 | cwd: '<%= config.dist %>/' 114 | src: ['**'] 115 | }] 116 | 117 | rename: 118 | main: 119 | dest: '<%= config.dist %>/assets/docs.zip' 120 | src: 'docs.zip' 121 | 122 | replace: 123 | index: 124 | src: ['<%= config.dist %>/index.html'] 125 | overwrite: true 126 | replacements:[{ 127 | from: '../' 128 | to: '' 129 | }] 130 | 131 | 132 | grunt.initConfig gruntConfig 133 | 134 | grunt.loadNpmTasks 'assemble' 135 | grunt.loadNpmTasks 'grunt-contrib-watch' 136 | grunt.loadNpmTasks 'grunt-contrib-clean' 137 | grunt.loadNpmTasks 'grunt-contrib-copy' 138 | grunt.loadNpmTasks 'grunt-contrib-connect' 139 | grunt.loadNpmTasks 'grunt-contrib-jshint' 140 | grunt.loadNpmTasks 'grunt-coffeelint' 141 | grunt.loadNpmTasks 'grunt-contrib-less' 142 | grunt.loadNpmTasks 'grunt-contrib-compress' 143 | grunt.loadNpmTasks 'grunt-rename' 144 | grunt.loadNpmTasks 'grunt-text-replace' 145 | 146 | grunt.registerTask 'server', ['build', 'connect:livereload', 'watch'] 147 | grunt.registerTask 'build', ['test', 'clean', 'assemble', 'less', 148 | 'copy', 'replace'] 149 | grunt.registerTask 'archive', ['compress', 'rename'] 150 | grunt.registerTask 'deploy', ['build', 'archive'] 151 | grunt.registerTask 'test', ['coffeelint'] 152 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Spark Documentation [](https://travis-ci.org/spark/docs) 2 | 3 | Here you'll find the documentation for the Spark platform, including the Spark Cloud and the Spark Core. 4 | 5 | To view this documentation, visit [our website](http://docs.spark.io), where the documentation is hosted. 6 | 7 | ### Installation 8 | 9 | To host this documentation locally, you'll need Node.js and npm: 10 | 11 | brew install nodejs 12 | 13 | If you don't already have Grunt installed, you'll need that too: 14 | 15 | npm install -g grunt-cli 16 | 17 | Once you have the dependencies, navigate to this repository's directory on your machine, and then: 18 | 19 | npm install 20 | 21 | to install any other necessary dependencies: 22 | 23 | ### Hosting locally 24 | 25 | This documentation uses Grunt and Assemble to build and push documentation updates. Once everything's installed, to build the documentation, type: 26 | 27 | `grunt build` 28 | 29 | The documentation will be located in the `build` directory. If you would like to host this documentation locally, try: 30 | 31 | `grunt server` 32 | 33 | This will set up a Connect server and load the local documentation in a web browser. If you make changes, the browser should automatically refresh. 34 | 35 | ### Deployment 36 | 37 | When updated documentation is pushed to the master branch, it is automatically pushed to Amazon S3 by Travis CI. 38 | 39 | Travis calls `grunt deploy`, which is the same as `grunt build`, except that it also zips up the docs for downloading. 40 | 41 | To see the latest build, visit the [Travis CI page](https://travis-ci.org/spark/docs). 42 | 43 | ### Organization 44 | 45 | The majority of the content herein is stored in the `src/content` directory as a set of Markdown files. Assets such as images and javascript are stored in the `src/assets` directory. 46 | 47 | ### Attributions 48 | 49 | Some of this documentation is derived from the [Arduino documentation](http://arduino.cc/en/Reference), as the Arduino/Wiring language and libraries are used extensively on the Spark Core. 50 | 51 | This documentation was originally built using [Flatdoc](http://ricostacruz.com/flatdoc/), an awesome tool for building beautiful documentation from simple Markdown files. We have made many modifications since, but the inspiration remains. 52 | 53 | ### Contributions 54 | 55 | This documentation is managed by Spark, but supported by the community. We welcome contributions such as: 56 | 57 | * Edits to improve grammar or fix typos 58 | * Edits to improve clarity 59 | * Additional annotated examples for others to follow 60 | * Additional content that would help provide a complete understanding of the Spark platform 61 | * Translations to other languages 62 | 63 | Making a contribution is as simple as forking this repository, making edits to your fork, and contributing those edits as a pull request. For more information on how to make a pull request, see [Github's documentation](https://help.github.com/articles/using-pull-requests). 64 | 65 | ### License 66 | 67 | These files have been made available online through a [Creative Commons Attribution-ShareAlike 3.0 license](http://creativecommons.org/licenses/by-sa/3.0/us/). 68 | 69 | You are welcome to distribute, remix, and use these files for commercial purposes. If you do so, please attribute the original design to Spark Labs, Inc. both on the website and on the physical packaging of the product or in the instruction manual. All derivative works must be published under the same or a similar license. 70 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | [ ] Fix the scroll spy thing that highlights the section where you are in the menu. Can’t get the mapping to work, David I might need a hand with this one. 2 | [ ] Compress all the assets and remove any external dependencies so it will run perfectly offline 3 | [ ] Improve the coloring on the code, which sometimes gets funky 4 | [ ] Make the headers for the code (like EXAMPLE SYNTAX) in regular fonts instead of monospace fonts so they stick out better 5 | [ ] Bring in the language ones 6 | [ ] Make tables more legible 7 | 8 | Feedback: 9 | I really love the main sections on the left side now. 10 | I love the sample code formatting on the side... 11 | however, I would like to see code "blocks" that we can use to distinguish a chunk of code from another chunk of code. I see places where we blast some firmware code, then right under it paste the API endpoint and a curl command. We should separate those somehow so the user doesn't think the curl command is part of the C++ code. 12 | Related, when i select the code (for copy/pasta) it's also selecting text from the docs, which makes it impossible to just copy and paste the example code. (Although the links to the example code on github is nice, sometimes it's easier to just copy it since I'm already here) 13 | Spark.publish() needs some example consumer code (such as a curl command to stream SSEs or some browser JS) (Actually I just found it in the cloud reference section. Maybe link between the two sections for Spark.publish()? 14 | the shield-shield pin mapping is a bit hard to read with the new font colors 15 | - Can the nav stuff scroll with the browser? I find myself scrolling a lot with the current docs. Or even a jump-to-top button that scrolls with you. Or, if all else fails, we can manually add jump-to-top links at the end of each section. 16 | - Can you send the CI alerts to Joe? That guy needs more alert e-mails. 17 | - The font on the LHS menu is pixelated and looks poor 18 | - The code font IS larger but in Chrome, looks a bit rough 19 | - Integrate headroom to bring the header back: http://wicky.nillia.ms/headroom.js/ 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spark-docs", 3 | "version": "0.2.0", 4 | "private": false, 5 | "scripts": { 6 | "start": "grunt server", 7 | "test": "grunt test" 8 | }, 9 | "dependencies": { 10 | "express": "3.4.4", 11 | "grunt": "~0.4.5", 12 | "lodash": "~2.4.1", 13 | "cheerio": "~0.16.0" 14 | }, 15 | "devDependencies": { 16 | "assemble": "~0.4.35", 17 | "assemble-contrib-permalinks": "0.3.4", 18 | "grunt-contrib-watch": "~0.5.3", 19 | "grunt-contrib-copy": "~0.5.0", 20 | "grunt-contrib-connect": "~0.7.1", 21 | "grunt-contrib-jshint": "~0.10.0", 22 | "grunt-coffeelint": "0.0.10", 23 | "grunt-contrib-clean": "~0.5.0", 24 | "grunt-contrib-less": "~0.11.0", 25 | "grunt-contrib-compress": "~0.9.1", 26 | "grunt-rename": "~0.1.3", 27 | "grunt-text-replace": "~0.3.11" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugins/toc/toc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Table of Contents generator. 4 | * 5 | * Based on: 6 | * Assemble Contrib Plugin: TOC 7 | * https://github.com/assemble/assemble-contrib-toc 8 | * 9 | * Copyright (c) 2013 Brian Woodward 10 | * @author: https://github.com/doowb 11 | * 12 | * @param {[type]} params [description] 13 | * @param {Function} callback [description] 14 | * @return {[type]} [description] 15 | */ 16 | 17 | var options = { 18 | stage: 'render:post:page' 19 | }; 20 | 21 | var cheerio = require('cheerio'); 22 | 23 | module.exports = function(params, callback) { 24 | 'use strict'; 25 | 26 | var grunt = params.grunt; 27 | var page = params.page; 28 | var content = params.content; 29 | 30 | var opts = page.data.toc || params.assemble.options.toc; 31 | 32 | // id to use to append TOC 33 | var id = '#' + (opts.id || 'toc'); 34 | var modifier = opts.modifier || ''; 35 | var li = opts.li ? (' class="' + opts.li + '"') : ''; 36 | 37 | // load current page content 38 | var $ = cheerio.load(content); 39 | var $toc = $(id); 40 | 41 | // create menu object 42 | var menu = []; 43 | 44 | $('.content').find('h1, h2, h3').each(function() { 45 | var $el = $(this); 46 | var level = +($el[0].name.substr(1)); 47 | 48 | var obj = { section: $el.text(), items: [], level: level, id: $el.attr('id') }; 49 | menu.push(obj); 50 | }); 51 | 52 | 53 | // Add the TOC 54 | if (menu.length > 0) { 55 | menu.forEach(function(item) { 56 | var id = item.id; 57 | 58 | var $li = $('
Memory Address | 176 |Content | 177 |Size | 178 |
---|---|---|
0x08000000 | 181 |Bootloader | 182 |19 KB max | 183 |
0x08004C00 | 186 |System Flags | 187 |1 KB max | 188 |
0x08005000 | 191 |Core Firmware Location | 192 |108 KB max | 193 |
Memory Address | 203 |Content | 204 |Size | 205 |
---|---|---|
0x00000 | 208 |Reserved | 209 |4KB | 210 |
0x01000 | 213 |Public Key | 214 |294 Bytes - 4KB max | 215 |
0x02000 | 218 |Private Key | 219 |612 Bytes | 220 |
0x20000 | 223 |Factory Reset Firmware Location | 224 |128 KB max | 225 |
0x40000 | 228 |BackUp Firmware Location | 229 |128 KB max | 230 |
0x60000 | 233 |OTA Firmware Location | 234 |128 KB max | 235 |
0x80000 | 238 |End of OTA Firmware | 239 ||
242 | | NOT USED | 243 ||
0x200000 | 246 |End of Flash Memory | 247 |
Parameter | 258 |Min | 259 |Max | 260 |
---|---|---|
Input Voltage (at VIN) | 263 |3.6 V | 264 |6.0 V | 265 |
Total Current Consumption | 268 |50mA | 269 |300mA | 270 |
Current Consumption in Deep Sleep | 273 |3.2 μA | 274 |- | 275 |
Current per I/O pin | 278 |8mA | 279 |20mA | 280 |
Parameter | 319 |Value | 320 |
---|---|
Length | 323 |1.47" | 324 |
Width | 327 |0.8" | 328 |
Height | 331 |0.5" | 332 |
Weight | 335 |14 grams | 336 |