├── .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 [![Build Status](https://travis-ci.org/spark/docs.svg?branch=feature/server-side-rendering)](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 = $('
  • ') 59 | .attr('id', id + '-item') 60 | .addClass('level-' + item.level); 61 | 62 | if (item.section) { 63 | var $a = $('') 64 | .html(item.section) 65 | .attr('id', id + '-link') 66 | .attr('href', '#' + id) 67 | .addClass('level-' + item.level); 68 | $li.append($a); 69 | } 70 | 71 | $toc.append($li); 72 | 73 | 74 | }); 75 | } 76 | 77 | params.content = $.html(); 78 | 79 | callback(); 80 | }; 81 | 82 | module.exports.options = options; 83 | -------------------------------------------------------------------------------- /plugins/verbose/verbose.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Create verbose anchors in the Spark docs. 4 | * Helps with links and navigation. 5 | * 6 | */ 7 | 8 | var options = { 9 | stage: 'render:post:page' 10 | }; 11 | 12 | var cheerio = require('cheerio'); 13 | 14 | module.exports = function(params, callback) { 15 | 'use strict'; 16 | 17 | var grunt = params.grunt; 18 | var page = params.page; 19 | var content = params.content; 20 | 21 | var opts = page.data.verbose || params.assemble.options.verbose; 22 | 23 | // Load current page content. 24 | var $ = cheerio.load(content); 25 | 26 | // Code to make a slug from some content. 27 | function slugify(text) { 28 | return text.toLowerCase().match(/[a-z0-9]+/g).join('-'); 29 | } 30 | 31 | // Slugify the H1s all regular-like. 32 | $('.content').find('h1').each(function() { 33 | var $el = $(this); 34 | var text = $el.text(); 35 | var id = slugify(text); 36 | $el.attr('id', id); 37 | }); 38 | 39 | // Append the H2 slugs to the H1 slugs. 40 | $('.content').find('h2').each(function() { 41 | var $el = $(this); 42 | var text = $el.text(); 43 | var id = slugify(text); 44 | var $parent = $el.prevAll('h1').first(); 45 | if ($parent.is('h1')) { 46 | var parent_id = slugify($parent.text()); 47 | $el.attr('id', parent_id + '-' + id); 48 | } else { 49 | $el.attr('id', id); 50 | } 51 | }); 52 | 53 | // And so on, and so forth. 54 | $('.content').find('h3').each(function() { 55 | var $el = $(this); 56 | var text = $el.text(); 57 | var id = slugify(text); 58 | var $parent = $el.prevAll('h2').first(); 59 | if ($parent.is('h2')) { 60 | var parent_id = slugify($parent.text()); 61 | $el.attr('id', parent_id + '-' + id); 62 | } else { 63 | $el.attr('id', id); 64 | } 65 | }); 66 | 67 | params.content = $.html(); 68 | 69 | callback(); 70 | }; 71 | 72 | module.exports.options = options; 73 | -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/buzzer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/buzzer.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/mini-dc-motor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/mini-dc-motor.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/photoresistor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/photoresistor.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/rgb-led.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/rgb-led.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/thermistor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/thermistor.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/tilt-sensor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/tilt-sensor.pdf -------------------------------------------------------------------------------- /src/assets/datasheets/makerkit/vibration-motor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/datasheets/makerkit/vibration-motor.pdf -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/fonts/Inconsolata.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/fonts/Inconsolata.otf -------------------------------------------------------------------------------- /src/assets/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/fonts/ionicons.eot -------------------------------------------------------------------------------- /src/assets/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/fonts/ionicons.ttf -------------------------------------------------------------------------------- /src/assets/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/fonts/ionicons.woff -------------------------------------------------------------------------------- /src/assets/images/.picasa.ini: -------------------------------------------------------------------------------- 1 | [smart-config.png.jpg] 2 | backuphash=28386 3 | [spark-apps.png.jpg] 4 | backuphash=33856 5 | [tinker-select.png.jpg] 6 | backuphash=12956 7 | -------------------------------------------------------------------------------- /src/assets/images/.picasaoriginals/.picasa.ini: -------------------------------------------------------------------------------- 1 | [smart-config.png] 2 | filters=crop64=1,2e4931b2d385cca9; 3 | crop=rect64(2e4931b2d385cca9) 4 | moddate=0000de3ff8cf0000 5 | width=990 6 | height=1870 7 | textactive=0 8 | [spark-apps.png] 9 | filters=crop64=1,2e4931f8d385cca9; 10 | crop=rect64(2e4931f8d385cca9) 11 | moddate=0000de3ff8cf0000 12 | width=990 13 | height=1870 14 | textactive=0 15 | [tinker-select.png] 16 | filters=crop64=1,2e49321bd301cc86; 17 | crop=rect64(2e49321bd301cc86) 18 | moddate=0000de3ff8cf0000 19 | width=990 20 | height=1870 21 | textactive=0 22 | -------------------------------------------------------------------------------- /src/assets/images/.picasaoriginals/smart-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/.picasaoriginals/smart-config.png -------------------------------------------------------------------------------- /src/assets/images/.picasaoriginals/spark-apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/.picasaoriginals/spark-apps.png -------------------------------------------------------------------------------- /src/assets/images/.picasaoriginals/tinker-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/.picasaoriginals/tinker-select.png -------------------------------------------------------------------------------- /src/assets/images/access-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/access-token.png -------------------------------------------------------------------------------- /src/assets/images/annotated-example1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/annotated-example1.jpg -------------------------------------------------------------------------------- /src/assets/images/breadboard-one-led.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/breadboard-one-led.jpg -------------------------------------------------------------------------------- /src/assets/images/breadboard-temp-sensor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/breadboard-temp-sensor.jpg -------------------------------------------------------------------------------- /src/assets/images/breadboard-two-leds.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/breadboard-two-leds.jpg -------------------------------------------------------------------------------- /src/assets/images/breathingCyan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/breathingCyan.gif -------------------------------------------------------------------------------- /src/assets/images/bshield-bottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/bshield-bottom.jpg -------------------------------------------------------------------------------- /src/assets/images/bshield-charging-powering.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/bshield-charging-powering.jpg -------------------------------------------------------------------------------- /src/assets/images/bshield-charging.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/bshield-charging.jpg -------------------------------------------------------------------------------- /src/assets/images/bshield-powering.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/bshield-powering.jpg -------------------------------------------------------------------------------- /src/assets/images/bshield-top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/bshield-top.jpg -------------------------------------------------------------------------------- /src/assets/images/build-libraries.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/build-libraries.jpg -------------------------------------------------------------------------------- /src/assets/images/build-library-github.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/build-library-github.jpg -------------------------------------------------------------------------------- /src/assets/images/chip-ufl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/chip-ufl.jpg -------------------------------------------------------------------------------- /src/assets/images/choose-app-to-include-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/choose-app-to-include-library.png -------------------------------------------------------------------------------- /src/assets/images/claim-a-core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/claim-a-core.png -------------------------------------------------------------------------------- /src/assets/images/coolterm-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/coolterm-settings.png -------------------------------------------------------------------------------- /src/assets/images/coolterm-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/coolterm-setup.png -------------------------------------------------------------------------------- /src/assets/images/core-bottom-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-bottom-view.jpg -------------------------------------------------------------------------------- /src/assets/images/core-buttons.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-buttons.jpg -------------------------------------------------------------------------------- /src/assets/images/core-cc3000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-cc3000.jpg -------------------------------------------------------------------------------- /src/assets/images/core-dim.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-dim.jpg -------------------------------------------------------------------------------- /src/assets/images/core-flashchip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-flashchip.jpg -------------------------------------------------------------------------------- /src/assets/images/core-in-box.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-in-box.jpg -------------------------------------------------------------------------------- /src/assets/images/core-leds.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-leds.jpg -------------------------------------------------------------------------------- /src/assets/images/core-pin-i2c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-pin-i2c.jpg -------------------------------------------------------------------------------- /src/assets/images/core-pin-spi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-pin-spi.jpg -------------------------------------------------------------------------------- /src/assets/images/core-pin-usart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-pin-usart.jpg -------------------------------------------------------------------------------- /src/assets/images/core-pins-jtag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-pins-jtag.jpg -------------------------------------------------------------------------------- /src/assets/images/core-power1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-power1.jpg -------------------------------------------------------------------------------- /src/assets/images/core-power2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-power2.jpg -------------------------------------------------------------------------------- /src/assets/images/core-regulator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-regulator.jpg -------------------------------------------------------------------------------- /src/assets/images/core-rf-test-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-rf-test-report.pdf -------------------------------------------------------------------------------- /src/assets/images/core-rf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-rf.jpg -------------------------------------------------------------------------------- /src/assets/images/core-s11-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-s11-chart.png -------------------------------------------------------------------------------- /src/assets/images/core-stm32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-stm32.jpg -------------------------------------------------------------------------------- /src/assets/images/core-top-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-top-view.jpg -------------------------------------------------------------------------------- /src/assets/images/core-usb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-usb.jpg -------------------------------------------------------------------------------- /src/assets/images/core-user-led.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/core-user-led.jpg -------------------------------------------------------------------------------- /src/assets/images/create-account.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/create-account.jpg -------------------------------------------------------------------------------- /src/assets/images/dashboard/logs-big-picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/dashboard/logs-big-picture.png -------------------------------------------------------------------------------- /src/assets/images/dashboard/raw-event.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/dashboard/raw-event.jpg -------------------------------------------------------------------------------- /src/assets/images/device-id.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/device-id.jpg -------------------------------------------------------------------------------- /src/assets/images/find-the-right-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/find-the-right-library.png -------------------------------------------------------------------------------- /src/assets/images/flashingBlue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/flashingBlue.gif -------------------------------------------------------------------------------- /src/assets/images/flashingGreen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/flashingGreen.gif -------------------------------------------------------------------------------- /src/assets/images/flashingMagenta.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/flashingMagenta.gif -------------------------------------------------------------------------------- /src/assets/images/flashingRed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/flashingRed.gif -------------------------------------------------------------------------------- /src/assets/images/fork-app.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/fork-app.jpg -------------------------------------------------------------------------------- /src/assets/images/github-download.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/github-download.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-compile-errors.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-compile-errors.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-compile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-compile.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-flash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-flash.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-functions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-functions.gif -------------------------------------------------------------------------------- /src/assets/images/ide-get-variable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-get-variable.gif -------------------------------------------------------------------------------- /src/assets/images/ide-i-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-i-button.png -------------------------------------------------------------------------------- /src/assets/images/ide-include-library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-include-library.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-log-in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-log-in.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-mem-usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-mem-usage.png -------------------------------------------------------------------------------- /src/assets/images/ide-menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-menu.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-palette.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-palette.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-select-core.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-select-core.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-selected-library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-selected-library.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-serial-monitor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-serial-monitor.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-toolbar-compile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-toolbar-compile.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-toolbar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-toolbar.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-watch-variable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-watch-variable.gif -------------------------------------------------------------------------------- /src/assets/images/ide-wifi-list.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-wifi-list.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-wifi-save.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-wifi-save.jpg -------------------------------------------------------------------------------- /src/assets/images/ide-window.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide-window.jpg -------------------------------------------------------------------------------- /src/assets/images/ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/ide.png -------------------------------------------------------------------------------- /src/assets/images/import-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/import-library.png -------------------------------------------------------------------------------- /src/assets/images/jtag-bottomview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/jtag-bottomview.jpg -------------------------------------------------------------------------------- /src/assets/images/jtag-setup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/jtag-setup.jpg -------------------------------------------------------------------------------- /src/assets/images/jtag-topview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/jtag-topview.jpg -------------------------------------------------------------------------------- /src/assets/images/library-drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/library-drawer.png -------------------------------------------------------------------------------- /src/assets/images/library-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/library-icon.png -------------------------------------------------------------------------------- /src/assets/images/log-in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/log-in.jpg -------------------------------------------------------------------------------- /src/assets/images/managing-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/managing-library.png -------------------------------------------------------------------------------- /src/assets/images/mk-10k-resistor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-10k-resistor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-1k-resistor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-1k-resistor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-330ohm-resistor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-330ohm-resistor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-buzzer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-buzzer.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-ceramic-capacitor-100nF.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-ceramic-capacitor-100nF.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-ceramic-capacitor-10nF.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-ceramic-capacitor-10nF.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-core-in-box.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-core-in-box.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-diode.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-diode.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-dpdt-switch.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-dpdt-switch.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-electrolytic-capacitor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-electrolytic-capacitor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-force-sensor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-force-sensor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-header-female.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-header-female.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-header-male-dual.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-header-male-dual.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-header-male.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-header-male.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-jumper-cables.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-jumper-cables.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-ldr.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-ldr.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-led-3mm.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-led-3mm.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-micro-rc-servo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-micro-rc-servo.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-mini-dc-motor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-mini-dc-motor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-mini-pushbutton.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-mini-pushbutton.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-npn-transistor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-npn-transistor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-pcb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-pcb.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-potentiometer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-potentiometer.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-rgb-led.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-rgb-led.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-shift-register.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-shift-register.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-temp-sensor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-temp-sensor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-thermistor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-thermistor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-tilt-sensor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-tilt-sensor.bmp -------------------------------------------------------------------------------- /src/assets/images/mk-vibration-motor.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/mk-vibration-motor.bmp -------------------------------------------------------------------------------- /src/assets/images/publish-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/publish-library.png -------------------------------------------------------------------------------- /src/assets/images/rc-car-jumpers-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/rc-car-jumpers-small.jpg -------------------------------------------------------------------------------- /src/assets/images/rc-car-motor-conn-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/rc-car-motor-conn-small.jpg -------------------------------------------------------------------------------- /src/assets/images/rc-car-power-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/rc-car-power-small.jpg -------------------------------------------------------------------------------- /src/assets/images/rc-car-top-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/rc-car-top-small.jpg -------------------------------------------------------------------------------- /src/assets/images/relay-shield-bulb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/relay-shield-bulb.jpg -------------------------------------------------------------------------------- /src/assets/images/relay-shield-setup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/relay-shield-setup.jpg -------------------------------------------------------------------------------- /src/assets/images/relay-shield-top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/relay-shield-top.jpg -------------------------------------------------------------------------------- /src/assets/images/select-a-core.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/select-a-core.jpg -------------------------------------------------------------------------------- /src/assets/images/smart-config copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/smart-config copy.png -------------------------------------------------------------------------------- /src/assets/images/smart-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/smart-config.jpg -------------------------------------------------------------------------------- /src/assets/images/spark-app.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-app.jpg -------------------------------------------------------------------------------- /src/assets/images/spark-apps copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-apps copy.png -------------------------------------------------------------------------------- /src/assets/images/spark-apps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-apps.jpg -------------------------------------------------------------------------------- /src/assets/images/spark-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-docs.png -------------------------------------------------------------------------------- /src/assets/images/spark-login-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-login-button.png -------------------------------------------------------------------------------- /src/assets/images/spark-login-modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-login-modal.png -------------------------------------------------------------------------------- /src/assets/images/spark-pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/spark-pinout.png -------------------------------------------------------------------------------- /src/assets/images/sparklogo-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/sparklogo-2x.png -------------------------------------------------------------------------------- /src/assets/images/sparklogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/sparklogo.png -------------------------------------------------------------------------------- /src/assets/images/sshield-bottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/sshield-bottom.jpg -------------------------------------------------------------------------------- /src/assets/images/sshield-setup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/sshield-setup.jpg -------------------------------------------------------------------------------- /src/assets/images/sshield-top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/sshield-top.jpg -------------------------------------------------------------------------------- /src/assets/images/tinker-select copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/tinker-select copy.png -------------------------------------------------------------------------------- /src/assets/images/tinker-select.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/tinker-select.jpg -------------------------------------------------------------------------------- /src/assets/images/tinker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/tinker.png -------------------------------------------------------------------------------- /src/assets/images/using-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/using-library.png -------------------------------------------------------------------------------- /src/assets/images/validate-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/validate-library.png -------------------------------------------------------------------------------- /src/assets/images/webhooks-librato-cli-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/webhooks-librato-cli-example.png -------------------------------------------------------------------------------- /src/assets/images/webhooks-librato-metric-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/webhooks-librato-metric-sample.png -------------------------------------------------------------------------------- /src/assets/images/webhooks-librato-metrics-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/webhooks-librato-metrics-screen.png -------------------------------------------------------------------------------- /src/assets/images/webhooks-librato-metrics-screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/webhooks-librato-metrics-screen1.png -------------------------------------------------------------------------------- /src/assets/images/webhooks_librato_example_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/images/webhooks_librato_example_1.png -------------------------------------------------------------------------------- /src/assets/js/animated-core.js: -------------------------------------------------------------------------------- 1 | var coreState = 0; 2 | 3 | function animateCore() { 4 | var core = $('#core1'); 5 | var button = $('#button1'); 6 | console.log(coreState); 7 | switch(coreState) { 8 | case 0: 9 | core.html('
    ') 10 | button.text('Listening for Wi-Fi credentials'); 11 | break; 12 | case 1: 13 | core.html('
    ') 14 | button.text('Connecting to the Wi-Fi network'); 15 | break; 16 | case 2: 17 | core.html('
    ') 18 | button.text('Connecting to the Spark Cloud'); 19 | break; 20 | case 3: 21 | core.html('
    ') 22 | button.text('Updating to newest firmware'); 23 | break; 24 | case 4: 25 | core.html('
    ') 26 | button.text('Connected!'); 27 | break; 28 | case 5: 29 | core.html('
    ') 30 | button.text('Start over'); 31 | break; 32 | } 33 | coreState++; 34 | if (coreState > 5) { 35 | coreState = 0; 36 | } 37 | } -------------------------------------------------------------------------------- /src/assets/js/docs.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | Documentation middleware. 4 | Created by Zach Supalla. 5 | (c) 2014 Spark Labs, Inc. MIT licensed. 6 | 7 | Derived from Flatdoc (http://ricostacruz.com/flatdoc) 8 | (c) 2013 Rico Sta. Cruz. MIT licensed. 9 | 10 | */ 11 | 12 | (function($) { 13 | var exports = this; 14 | 15 | /** 16 | * Basic Docs module. 17 | */ 18 | 19 | var Docs = exports.Docs = {}; 20 | 21 | Docs.transform = function() { 22 | this.tagImages(); 23 | this.buttonize(); 24 | this.prettifyCode(); 25 | }; 26 | 27 | /** 28 | * Tags paragraphs that include images. 29 | */ 30 | 31 | Docs.tagImages = function() { 32 | $('.content').find('p:has(img)').each(function() { 33 | var $el = $(this); 34 | $el.addClass('img'); 35 | }); 36 | }; 37 | 38 | /** 39 | * Changes "button >" text to buttons. 40 | */ 41 | 42 | Docs.buttonize = function() { 43 | $('.content').find('a').each(function() { 44 | var $a = $(this); 45 | 46 | var m = $a.text().match(/^(.*) >$/); 47 | if (m) $a.text(m[1]).addClass('button'); 48 | }); 49 | }; 50 | 51 | /** 52 | * Make code prettier 53 | */ 54 | 55 | Docs.prettifyCode = function() { 56 | $('.content').find('pre code').each(function() { 57 | $(this).addClass("prettyprint"); 58 | }); 59 | }; 60 | 61 | // Ok, then let's do it! 62 | Docs.transform(); 63 | prettyPrint(); 64 | 65 | })(jQuery); 66 | -------------------------------------------------------------------------------- /src/assets/js/jquery-styling.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | var $window = $(window); 3 | var $document = $(document); 4 | 5 | /* 6 | * Redirect a hash map. 7 | */ 8 | 9 | if (window.location.hash.indexOf("#/") === 0) { 10 | var remainder = window.location.hash.substring(2); 11 | var slash = remainder.indexOf("/"); 12 | 13 | if (slash >= 0) { 14 | var redirect = remainder.substring(0, slash) + "#" + remainder.substring(slash+1); 15 | window.location = redirect; 16 | } else { 17 | window.location = remainder; 18 | } 19 | } 20 | 21 | /* 22 | * Sidebar stick. 23 | */ 24 | 25 | $(function() { 26 | var $sidebar = $('.menubar'); 27 | var elTop; 28 | 29 | $window 30 | .on('resize.sidestick', function() { 31 | elTop = $sidebar.offset().top; 32 | if($window.scrollTop() < elTop) { 33 | $window.trigger('scroll.sidestick'); 34 | } 35 | 36 | }) 37 | .on('scroll.sidestick', function() { 38 | var scrollY = $window.scrollTop(); 39 | $sidebar.toggleClass('fixed', (scrollY >= elTop)); 40 | }) 41 | .trigger('resize.sidestick'); 42 | }); 43 | 44 | })(jQuery); 45 | 46 | /*! fillsize (c) 2012, Rico Sta. Cruz. MIT License. 47 | * http://github.com/rstacruz/jquery-stuff/tree/master/fillsize */ 48 | 49 | // Makes an element fill up its container. 50 | // 51 | // $(".container").fillsize("> img"); 52 | // 53 | // This binds a listener on window resizing to automatically scale down the 54 | // child (`> img` in this example) just so that enough of it will be visible in 55 | // the viewport of the container. 56 | // 57 | // This assumes that the container has `position: relative` (or any 'position', 58 | // really), and `overflow: hidden`. 59 | 60 | (function($) { 61 | $.fn.fillsize = function(selector) { 62 | var $parent = this; 63 | var $img; 64 | 65 | function resize() { 66 | if (!$img) $img = $parent.find(selector); 67 | 68 | $img.each(function() { 69 | if (!this.complete) return; 70 | var $img = $(this); 71 | 72 | var parent = { height: $parent.innerHeight(), width: $parent.innerWidth() }; 73 | var imageRatio = $img.width() / $img.height(); 74 | var containerRatio = parent.width / parent.height; 75 | 76 | var css = { 77 | position: 'absolute', 78 | left: 0, top: 0, right: 'auto', bottom: 'auto' 79 | }; 80 | 81 | // If image is wider than the container 82 | if (imageRatio > containerRatio) { 83 | css.left = Math.round((parent.width - imageRatio * parent.height) / 2) + 'px'; 84 | css.width = 'auto'; 85 | css.height = '100%'; 86 | } 87 | 88 | // If the container is wider than the image 89 | else { 90 | css.top = Math.round((parent.height - (parent.width / $img.width() * $img.height())) / 2) + 'px'; 91 | css.height = 'auto'; 92 | css.width = '100%'; 93 | } 94 | 95 | $img.css(css); 96 | }); 97 | } 98 | 99 | // Make it happen on window resize. 100 | $(window).resize(resize); 101 | 102 | // Allow manual invocation by doing `.trigger('fillsize')` on the container. 103 | $(document).on('fillsize', $parent.selector, resize); 104 | 105 | // Resize on first load (or immediately if called after). 106 | $(function() { 107 | // If the child is an image, fill it up when image's real dimensions are 108 | // first determined. Needs to be .bind() because the load event will 109 | // bubble up. 110 | $(selector, $parent).bind('load', function() { 111 | setTimeout(resize, 25); 112 | }); 113 | 114 | resize(); 115 | }); 116 | 117 | return this; 118 | }; 119 | })(jQuery); 120 | -------------------------------------------------------------------------------- /src/assets/js/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 2 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-basic.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", 3 | /^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /src/assets/js/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 2 | ["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-dart.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 2 | ["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), 3 | ["dart"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-erlang.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 2 | ["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); 2 | -------------------------------------------------------------------------------- /src/assets/js/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-llvm.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); 2 | -------------------------------------------------------------------------------- /src/assets/js/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 2 | ["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 2 | ["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-mumps.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, 2 | null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /src/assets/js/lang-pascal.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], 3 | ["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /src/assets/js/lang-r.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], 2 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-rd.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); 2 | -------------------------------------------------------------------------------- /src/assets/js/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, 2 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-tcl.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", 3 | /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); 2 | -------------------------------------------------------------------------------- /src/assets/js/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 2 | null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 2 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 3 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); 4 | -------------------------------------------------------------------------------- /src/assets/js/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); 2 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /src/assets/js/scrollspy.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: scrollspy.js v3.1.1 3 | * http://getbootstrap.com/javascript/#scrollspy 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // SCROLLSPY CLASS DEFINITION 14 | // ========================== 15 | 16 | function ScrollSpy(element, options) { 17 | var href 18 | var process = $.proxy(this.process, this) 19 | 20 | this.$element = $(element).is('body') ? $(window) : $(element) 21 | this.$body = $('body') 22 | this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) 23 | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 24 | this.selector = (this.options.target 25 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 26 | || '') + ' .nav li > a' 27 | this.offsets = $([]) 28 | this.targets = $([]) 29 | this.activeTarget = null 30 | 31 | this.refresh() 32 | this.process() 33 | } 34 | 35 | ScrollSpy.DEFAULTS = { 36 | offset: 10 37 | } 38 | 39 | ScrollSpy.prototype.refresh = function () { 40 | var offsetMethod = this.$element[0] == window ? 'offset' : 'position' 41 | 42 | this.offsets = $([]) 43 | this.targets = $([]) 44 | 45 | var self = this 46 | var $targets = this.$body 47 | .find(this.selector) 48 | .map(function () { 49 | var $el = $(this) 50 | var href = $el.data('target') || $el.attr('href') 51 | var $href = /^#./.test(href) && $(href) 52 | 53 | return ($href 54 | && $href.length 55 | && $href.is(':visible') 56 | && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null 57 | }) 58 | .sort(function (a, b) { return a[0] - b[0] }) 59 | .each(function () { 60 | self.offsets.push(this[0]) 61 | self.targets.push(this[1]) 62 | }) 63 | } 64 | 65 | ScrollSpy.prototype.process = function () { 66 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 67 | var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight 68 | var maxScroll = scrollHeight - this.$scrollElement.height() 69 | var offsets = this.offsets 70 | var targets = this.targets 71 | var activeTarget = this.activeTarget 72 | var i 73 | 74 | if (scrollTop >= maxScroll) { 75 | return activeTarget != (i = targets.last()[0]) && this.activate(i) 76 | } 77 | 78 | if (activeTarget && scrollTop <= offsets[0]) { 79 | return activeTarget != (i = targets[0]) && this.activate(i) 80 | } 81 | 82 | for (i = offsets.length; i--;) { 83 | activeTarget != targets[i] 84 | && scrollTop >= offsets[i] 85 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 86 | && this.activate( targets[i] ) 87 | } 88 | } 89 | 90 | ScrollSpy.prototype.activate = function (target) { 91 | this.activeTarget = target 92 | 93 | $(this.selector) 94 | .parentsUntil(this.options.target, '.active') 95 | .removeClass('active') 96 | 97 | var selector = this.selector + 98 | '[data-target="' + target + '"],' + 99 | this.selector + '[href="' + target + '"]' 100 | 101 | var active = $(selector) 102 | .parents('li') 103 | .addClass('active') 104 | 105 | if (active.parent('.dropdown-menu').length) { 106 | active = active 107 | .closest('li.dropdown') 108 | .addClass('active') 109 | } 110 | 111 | active.trigger('activate.bs.scrollspy') 112 | } 113 | 114 | 115 | // SCROLLSPY PLUGIN DEFINITION 116 | // =========================== 117 | 118 | var old = $.fn.scrollspy 119 | 120 | $.fn.scrollspy = function (option) { 121 | return this.each(function () { 122 | var $this = $(this) 123 | var data = $this.data('bs.scrollspy') 124 | var options = typeof option == 'object' && option 125 | 126 | if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 127 | if (typeof option == 'string') data[option]() 128 | }) 129 | } 130 | 131 | $.fn.scrollspy.Constructor = ScrollSpy 132 | 133 | 134 | // SCROLLSPY NO CONFLICT 135 | // ===================== 136 | 137 | $.fn.scrollspy.noConflict = function () { 138 | $.fn.scrollspy = old 139 | return this 140 | } 141 | 142 | 143 | // SCROLLSPY DATA-API 144 | // ================== 145 | 146 | $(window).on('load', function () { 147 | $('[data-spy="scroll"]').each(function () { 148 | var $spy = $(this) 149 | $spy.scrollspy($spy.data()) 150 | }) 151 | }) 152 | 153 | }(jQuery); 154 | -------------------------------------------------------------------------------- /src/assets/orange.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/particle-iot-archived/docs-old/b98c6e0196d3722f7e017b9cf5a27dfbe870cf6b/src/assets/orange.ico -------------------------------------------------------------------------------- /src/content/build.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Build 3 | title: Web IDE (Build) 4 | order: 5 5 | --- 6 | 7 | Flash Apps with Spark Build 8 | === 9 | 10 | Logging In 11 | --- 12 | When you're ready to reprogram your Spark Core, head over to our IDE: 13 | 14 | [Spark Build >](https://www.spark.io/build) 15 | 16 | ![Spark Build]({{assets}}/images/create-account.jpg) 17 | 18 | Creating an account is a simple one-step process. When presented with the login screen, simply enter your email address (careful!), and desired account password. Press the big friendly "Sign Up" button, and you'll reach the Spark Build home page. 19 | 20 | ![Spark Build]({{assets}}/images/log-in.jpg) 21 | 22 | If you've already logged into Spark Build before, click the "Let me log in" text beneath the Sign Up button, and you'll be presented with a login for existing users. Don't worry--if you already have an account and accidentally click the "Sign Up" button, we'll still log you into your existing account. 23 | 24 | Web IDE 25 | --- 26 | 27 | ![Spark Build]({{assets}}/images/ide.png) 28 | 29 | Spark Build is an Integrated Development Environment, or IDE; that means that you can do software development in an easy-to-use application, which just so happens to run in your web browser. 30 | 31 | Spark Build starts with the navigation bar on the left. On the top, there are three buttons, which serve important functions: 32 | 33 | - **Flash**: Flashes the current code to the Spark Core. This initiates an *over-the-air firmware update* and loads the new software onto your Spark Core. 34 | - **Verify**: This compiles your code without actually flashing it to the Core; if there are any errors in your code, they will be shown in the debug console on the bottom of the screen. 35 | - **Save**: Saves any changes you've made to your code. 36 | 37 | At the bottom, there are four more buttons to navigate through the IDE: 38 | 39 | - **Code**: Shows a list of your firmware applications and lets you select which one to edit/flash. 40 | - **Library**: Explore libraries submitted by other users, and develop your own. 41 | - **Docs**: Brings you to the documentation for Spark. 42 | - **Cores**: Shows a list of your Spark Cores, so you can choose which to flash, and get more information on each Core. 43 | - **Settings**: Change your password, log out, or get your access token for API calls. 44 | 45 | Keyboard Shortcuts 46 | --- 47 | 48 | Missing your keyboard shortcuts? [This cheatsheet will help.](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts) 49 | 50 | Spark Apps and Libraries 51 | --- 52 | 53 | ![Spark Build]({{assets}}/images/spark-apps.jpg) 54 | 55 | The heart of Spark Build is the "Spark Apps" section, which displays the name of the current app in your editor, as well as a list of your other applications and community-supported example apps. 56 | 57 | The application you've got open in the editor is displayed under the "Current App" header. You'll notice that this "HELLOWORLD" sample application has only one file, but firmware with associated libraries/multiple files are fully supported. 58 | 59 | From this pane, you've got a lot of buttons and actions available to you that can help you grow and manage your library of kick-ass applications: 60 | 61 | - **Create**: You can create a new application by clicking the "Create New App" button. Give it a sweet name and press enter! Your app is now saved to your account and ready for editing. 62 | 63 | - **Delete**: Click the "Remove App" button to remove it forever from your Spark library. 64 | 65 | - **Rename**: You can rename your Spark App by simply double-clicking on the title of your app under the "Current App" header. You can modify the "Optional description" field in the same way. 66 | - **My Apps**: Tired of working on your current project? Select the name of another app under the "My apps" header to open it in a tab of the Spark Build editor. 67 | 68 | - **Files**: This header lists all known files associated with the open application. Click on a supporting file in your application to open it as an active tab in the editor. 69 | 70 | - **Examples**: The "Example apps" header lists a continuously growing number of community-supported example apps. Use these apps as references for developing your own, or fork them outright to extend their functionality. 71 | 72 | 73 | Flashing Your First App 74 | --- 75 | 76 | The best way to get started with the IDE is to start writing code: 77 | 78 | - **Connect**: Make sure your Core is powered and "breathing" Cyan, which indicates that it's connected to the Spark Cloud and ready to be updated. 79 | - **Get Code**: Try clicking on the "Blink an LED" example under the "Example apps" header. The Spark Build editor should display the code for the example application in an active tab. Alternatively, you can copy and paste this snippet of code into a new application in the Build IDE. 80 | 81 | ``` 82 | //D7 LED Flash Example 83 | int LED = D7; 84 | 85 | void setup() { 86 | pinMode(LED, OUTPUT); 87 | } 88 | 89 | void loop() { 90 | digitalWrite(LED, HIGH); 91 | delay(1000); 92 | digitalWrite(LED, LOW); 93 | delay(1000); 94 | } 95 | ``` 96 | 97 | ![Spark Build]({{assets}}/images/select-a-core.jpg) 98 | 99 | 100 | - **Select Your Core**: The next step is to make sure that you've selected which of your Cores to flash code to. Click on the "Cores" icon at the bottom left side of the navigation pane, and click on the star next to the Core you'd like to update. Once you've selected a Core, the star associated with it will turn yellow. (If you only have one core, there is no need to select it, you can continue on to the next step). 101 | 102 | - **Flash**: Click the "Flash" button, and your code will be sent wirelessly to your Core. If the flash was successful, the LED on your Core will begin flashing magenta. 103 | 104 | ![Spark Build]({{assets}}/images/fork-app.jpg) 105 | 106 | - **Fork**: Wish the timing of that LED flash was a little bit faster? Try clicking on the "Fork This Example" button after selecting the "Blink An LED" example application. You've now got a personal copy of that application that you can modify, save, and flash to all of your Cores. 107 | 108 | - **Edit**: Try changing the values in the delay() function from 1000 to 250, which changes the timing interval from 1000 milliseconds to only 250 milliseconds. Click the Verify button, then the Flash button. Is your Core's LED blinking faster? Well done :) 109 | 110 | 111 | Account Information 112 | --- 113 | 114 | There are a couple of other neat bells and whistles in Spark Build. The Spark Build IDE the best tool for viewing important information about your Core, managing Cores associated with your Spark account, and "unclaiming" them so they can be transferred to your buddy. 115 | 116 | ![Spark Build]({{assets}}/images/device-id.jpg) 117 | 118 | - **Core ID**: You can view your Core's Device ID by clicking on the "Cores" icon at the bottom of the navigation pane, then clicking the dropdown arrow next to the Core of interest. 119 | 120 | - **Unclaim**: You can "Unclaim" a Core by pressing the "Remove Core" button that is revealed by clicking the dropdown arrow. Once a Core has been unclaimed, it is available to be reassociated with any Spark users' account. 121 | 122 | ![Spark Build]({{assets}}/images/access-token.png) 123 | 124 | - **API Key**: You can find your most recent API Key listed under the "Settings" tab in your account. You can press the "Reset Token" button to assign a new API Key to your account. *Note* that pressing this button will require you to update any hard-coded API Credentials in your Spark-powered projects! 125 | 126 | 127 | Using Libraries 128 | --- 129 | 130 | ![Include the library]({{assets}}/images/choose-app-to-include-library.png) 131 | 132 | When you want to reuse code across multiple applications, Spark Libraries are your friend. 133 | Spark Libraries are easily shareable, extensible packages built by the community to help with common problems many Spark applications encounter. They are hosted on GitHub and easily pulled into the IDE where they can be included in apps and shared with others. 134 | 135 | You can include a library in an application by opening the library drawer, finding a library that will work for your project, and clicking the "include in app" button. This will add an `#include` statement to your code that will expose all the capabilities of the library to your code. 136 | 137 | Contribute a library 138 | --- 139 | 140 | ![Validate library]({{assets}}/images/validate-library.png) 141 | 142 | Adding a library to the IDE starts by creating an open source GitHub repository where your code will live. 143 | At minimum, this repository needs a `spark.json` file, some documentation, some example firmware files, and some Arduino/C++ files. 144 | The import and validation process is designed to be forgiving and easy to interpret, so don't be scared; the IDE will walk you through what is required to get your library set to go. 145 | 146 | The easiest way to generate library boilerplate code is to follow the instructions on the [getting started section](https://github.com/spark/uber-library-example/#getting-started) of the `uber-library-example`, a project designed to illustrate and document what a library is supposed to look like. 147 | 148 | Checking code memory usage 149 | --- 150 | 151 | !["i" button]({{assets}}/images/ide-i-button.png) 152 | 153 | Whenever you **verify** your code and it compiles successfully, an "i" button will be displayed at the console output window. 154 | 155 | This allows you to view the amount of FLASH and RAM used by this particular code/app that is currently being worked on. 156 | 157 | _If there are no code changes and you **verify** code for the second time, the "i" button will not be available. You can simply add an extra blank space or new line before you **verify** and the "i" button will now appear._ 158 | 159 | ![Code memory information]({{assets}}/images/ide-mem-usage.png) 160 | 161 | Wait, what is firmware? 162 | --- 163 | 164 | An *embedded system* like the Spark Core doesn't have an Operating System like a traditional computer. Instead, it runs a single application, often called *firmware*, which runs whenever the system is powered. 165 | 166 | *Firmware* is so-called because it's harder than software and softer than hardware. Hardware is fixed during manufacturing, and doesn't change. Software can be updated anytime, so it's very flexible. Firmware is somewhere in between; hardware companies do issue firmware updates, but they tend to be very infrequent, because upgrading firmware can be difficult. 167 | 168 | In our case, because the Spark Core is connected to the internet, updating firmware is quite trivial; we send it over the network, and we have put in place safeguards to keep you from "bricking" the Core. 169 | 170 | When you flash code onto the Spark Core, you are doing an *over-the-air firmware update*. This firmware update overwrites almost all of the software on the Spark Core; the only piece that is untouched is the bootloader, which manages the process of loading new firmware and ensures you can always update the firmware over USB or through a factory reset. 171 | -------------------------------------------------------------------------------- /src/content/dashboard.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Dashboard 3 | title: Dashboard 4 | order: 7 5 | --- 6 | 7 | 8 | Dashboard (alpha) 9 | ========== 10 | 11 | Introduction 12 | === 13 | 14 | The [Dashboard](https://dashboard.spark.io) is a new feature we're working on to make creating products easier. It's currently in alpha, which means we'll be working on it and releasing frequent updates. Stuff might change a lot over the next few weeks, so check back often! 15 | 16 | Being in alpha also means we're trying to get your feedback as we build it. Head on over to the community to join the conversation. We'll be making release announcements, answering questions and asking for feedback. 17 | 18 | [Talk to us on the Community! >](http://community.spark.io/t/fleet-management-dashboard-alpha-run-feedback/11118) 19 | 20 | Features 21 | === 22 | 23 | ### Home (Coming Soon) 24 | 25 | The Dashboard will show you an overview of your devices and their activity. It’ll let you easily monitor which devices are online, what code they’re running, and what data they’re sending back. 26 | 27 | ### Logs 28 | 29 | You can watch events published from your devices with `Spark.publish()` come in, in realtime. 30 | 31 | [![Logs App]({{assets}}/images/dashboard/logs-big-picture.png)]({{assets}}/images/dashboard/logs-big-picture.png) 32 | 33 | 34 | 35 | The Logs feature provides a clean interface to view event information in real-time, just from your devices. We're hoping that this is handy both while debugging code during development, and checking out recent activity on your device once you power-on your finished project. Here’s a snapshot of a Spark device monitoring the health of a theoretical aquarium. 36 | 37 | Let's look at it starting at the top. 38 | 39 | Near the title, we've got a button to pause and un-pause the event stream. 40 | 41 | There's also an icon of a terminal window. When you click on it, we give you a hint on how to get the same information from the API. 42 | 43 | Below the title is a side-scrolling bar graph. It's a visualization of the number of events from your devices over time. Each color in the bar graph represents a unique event name. Each bar is 5 seconds in duration. 44 | 45 | 46 | 47 | [![Raw event]({{assets}}/images/dashboard/raw-event.jpg)]({{assets}}/images/dashboard/raw-event.jpg) 48 | 49 | 50 | 51 | At the bottom is a real-time log of events passing through the cloud. You'll get the name, data, timestamp and the device name associated with each event as it comes in. Oh Yeah! And, if you click on the event, you can see a raw JSON view of the event. 52 | 53 | In this view, you'll only see events that come in while the browser window is open. 54 | 55 | 56 | ### Devices (Coming Soon) 57 | 58 | The Devices view will display all your devices, their status, last messages, IDs, and manage their ownership. 59 | 60 | ### Data (Coming Soon) 61 | 62 | The Data view will provide a processed view of the stored and incoming data, sorted by event and graphed where possible. You can also download stored data from here. 63 | 64 | ### Errors (Coming Soon) 65 | 66 | Errors is where you’ll go to track alert messages that you’ve defined in your code. Think of it as `Serial.println()`, but with history and insights. 67 | 68 | ### Settings (Coming Soon) 69 | 70 | Settings is where to find all the account things you’d expect, plus access token management. 71 | -------------------------------------------------------------------------------- /src/content/dev.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Dev 3 | title: Spark Dev 4 | order: 6 5 | --- 6 | 7 | Build Apps with Spark Dev 8 | === 9 | 10 | Introduction 11 | === 12 | 13 | ![IDE Menu]({{assets}}/images/ide-menu.jpg) 14 | 15 | **Spark dev** is a desktop application that allows you to work with local copies of your firmware files. However, **internet** access is required as the files are pushed to Spark Cloud for compilation and returns a binary. i.e. This is not an offline development tool, yet. 16 | 17 | All the commands are available from the **Spark** menu. The menu changes depending on whether you're logged in or have selected a device, so some of the commands will only show up once you're in the right context. 18 | 19 | ![Command Palette]({{assets}}/images/ide-palette.jpg) 20 | 21 | If you prefer a keyboard-oriented workflow, there's **Command Palette** with all available commands in a searchable list. 22 | 23 | To show the palette press `Command`+`Shift`+`P` keys together on a Mac or `Control`+`Shift`+`P` on Windows. 24 | 25 | ![Toolbar]({{assets}}/images/ide-toolbar.jpg) 26 | **Tip**: you can change toolbar's position in settings. 27 | 28 | There's also a toolbar on left side of IDE which contains shortcuts to the most frequently used commands like compiling and flashing (looks a lot like the one from [Web IDE (Build)](/build), doesn't it?). 29 | 30 | Logging In 31 | --- 32 | If you want to work on more advanced projects, Spark Dev could be the choice for you. Head over and download latest release: 33 | 34 | [Spark Dev Download >](https://github.com/spark/spark-dev/releases/latest) 35 | 36 | ![IDE Window]({{assets}}/images/ide-window.jpg) 37 | 38 | To access most of features you need to log in using your Spark account (which you can [create here](https://www.spark.io/signup)) by clicking the link on the bottom of the window. 39 | 40 | ![Logging in]({{assets}}/images/ide-log-in.jpg) 41 | 42 | Enter your email and password then click the "Log In" button. After a successful login, the dialog will hide and a link will appear at the bottom showing your current account email. 43 | 44 | **NOTE**: When using [Command Line](/cli) you'll notice that log-in status is shared between Spark Dev and CLI. So if you successfully ran `spark login`, you will be logged in within the Spark Dev. 45 | 46 | Selecting device 47 | --- 48 | 49 | ![Selecting device]({{assets}}/images/ide-select-core.jpg) 50 | 51 | Most features like **Flashing** or accessing **Cloud variables and functions** require selecting a target device they will interact with. 52 | 53 | There are three ways to select core: 54 | 55 | * Click **Select device** button in the left toolbar 56 | * Click device's name on the bottom of the window 57 | * Click on **Spark** -> **Select device...** menu 58 | 59 | Then you will see list of all your devices along with an indicator of online status. You can search for a specific one by typing its name. Clicking on the device or pressing `Enter` when a device is selected will select it. 60 | 61 | Compiling code 62 | --- 63 | 64 | Before compiling your project, make sure your project files are in a dedicated directory. If other files not related to your project are present in the project directory, you may experience errors when trying to compile. 65 | 66 | ![Compile button]({{assets}}/images/ide-compile.jpg) 67 | 68 | To compile your current project, click on the **Compile in the cloud** button. If your code doesn't contain errors, you'll see a new file named **firmware_X.bin** in your project's directory (where *X* is a timestamp). 69 | 70 | ![Compile errors]({{assets}}/images/ide-compile-errors.jpg) 71 | 72 | If there are some errors, you'll see a list of them allowing you to quickly jump to relevant line in code. You can show this list by clicking red error icon on the bottom of the window. 73 | 74 | Flashing device 75 | --- 76 | 77 | ![Flash button]({{assets}}/images/ide-flash.jpg) 78 | 79 | When you're sure that your code is correct it's time to flash it to the device. To do this, click **Flash using cloud** button. Your code will be sent wirelessly to your device. If the request was successful, the LED on your device will begin flashing magenta as code is downloaded to it. The process is complete when the magenta is replaced by your online status indication patterns. 80 | 81 | Cloud variables & functions 82 | === 83 | 84 | To access all registered variables and functions, go to **Spark** -> **Show cloud functions**/**Show cloud functions** menus. 85 | 86 | Variables 87 | --- 88 | 89 | ![Getting variable]({{assets}}/images/ide-get-variable.gif) 90 | 91 | All variables declared with [Spark.variable()](http://docs.spark.io/firmware/#spark-variable) are shown on the left side of panel. To poll lastest variable value, click **Refresh** button for variable you want to update. 92 | 93 | ![Watching variable]({{assets}}/images/ide-watch-variable.gif) 94 | 95 | When you want to check variable value constantly, you can click **Watch** button. When a variable is watched, Spark Dev will fetch latest value every 5 seconds. 96 | 97 | Functions 98 | --- 99 | 100 | ![Functions]({{assets}}/images/ide-functions.gif) 101 | 102 | To call an [exposed function](http://docs.spark.io/firmware/#spark-function) simply click on the button with its name. You'll see any data the function returns on the right side. 103 | 104 | You can also add parameters to the call by entering them to the right of button. 105 | 106 | Managing device 107 | === 108 | 109 | Using Spark Dev you can do many things with your device including setting up its WiFi, claiming or renaming it. 110 | 111 | Setting up WiFi 112 | --- 113 | 114 | ![WiFi list]({{assets}}/images/ide-wifi-list.jpg) 115 | 116 | To setup device's WiFi, connect it via USB and click **Setup device's WiFi...** button on the toolbar. 117 | 118 | If your device isn't in [listening mode](/connect/#connecting-your-core-listening-mode) you'll see animation showing how to enter it. 119 | 120 | Next you'll see all available networks. The one you are currently connected to will be listed first. 121 | 122 | Select the one you want your device to use or choose **Enter SSID manually** (listed last) to specify all information by hand. 123 | 124 | ![WiFi setup]({{assets}}/images/ide-wifi-save.jpg) 125 | 126 | Now you need to fill missing information and click **Save**. Core will go dark for a second and then try to connect to the WiFi. 127 | 128 | Using community libraries 129 | === 130 | 131 | Currently community libraries aren't supported natively (but we're working on it). You can still use them, just follow these instructions: 132 | 133 | ![Libraries]({{assets}}/images/build-libraries.jpg) 134 | 135 | Find the [library you want to use](/build/#flash-apps-with-spark-build-using-libraries) 136 | 137 | ![Link to GitHub repository]({{assets}}/images/build-library-github.jpg) 138 | 139 | View it on GitHub 140 | 141 | ![Download link]({{assets}}/images/github-download.jpg) 142 | 143 | Download the repository 144 | 145 | ![Correct files selected]({{assets}}/images/ide-selected-library.jpg) 146 | 147 | Copy files from `firmware` directory **without** `examples` to your project directory 148 | 149 | ![Example project with include]({{assets}}/images/ide-include-library.jpg) 150 | 151 | Include library adding `#include "LIBRARY.h"` to your code 152 | -------------------------------------------------------------------------------- /src/content/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Examples 3 | title: Examples 4 | order: 2 5 | --- 6 | 7 | Annotated examples 8 | ======= 9 | 10 | Here you will find a bunch of examples to get you started with your new Spark Core! 11 | 12 | Blink an LED 13 | === 14 | 15 | ![One LED illustration]({{assets}}/images/annotated-example1.jpg) 16 | 17 | Blinking an LED is the ["Hello World"](http://en.wikipedia.org/wiki/Hello_world_program) example of the microcontroller world. It's a nice way to warm up and start your journey into the land of embedded hardware. 18 | 19 | For this example, you will need a Spark Core (duh!), a Breadboard, an LED, a Resistor (we will soon find out a suitable value) and a USB cable. 20 | 21 | Connect everything together as shown in the picture. The negative (shorter) pin of the LED is connected to ground via a resistor and the positive (longer) pin is connected to D0. 22 | 23 | ![One LED setup]({{assets}}/images/breadboard-one-led.jpg) 24 | 25 | But wait, what's the value of the resistor again? 26 | 27 | *Here's how we find that out:* 28 | 29 | According to [Ohm's Law](http://en.wikipedia.org/wiki/Ohm%27s_law) : Voltage = Current x Resistance 30 | 31 | Therefore, Resistance = Voltage/ Current 32 | 33 | In our case, the output voltage of the Core is 3.3V but the LED (typically) has a forward voltage drop of around 2.0V. So the actual voltage would be: 34 | 35 | 3.3V - 2.0V = 1.3V 36 | 37 | The required current to light up an LED varies any where between 2mA to 20mA. More the current, brighter the intensity. But generally its a good idea to drive the LED at a lower limit to prolong its life span. We will choose a drive current of 5mA. 38 | 39 | Hence, Resistance = 1.3V/ 5mA = 260 Ohms 40 | 41 | **NOTE:** Since there is so much variation in the values of the forward voltage drop of the LEDs depending upon type, size, color, manufacturer, etc., you could successfully use a resistor value from anywhere between 220Ohms to 1K Ohms. 42 | 43 | In the picture above, we used a 1K resistor (Brown Black Red) 44 | 45 | Now on to the actual program: 46 | 47 | ```cpp 48 | // Program to blink an LED connected to pin D0 49 | // of the Spark Core. 50 | 51 | // We name pin D0 as led 52 | int led = D0; 53 | 54 | // This routine runs only once upon reset 55 | void setup() 56 | { 57 | // Initialize D0 pin as output 58 | pinMode(led, OUTPUT); 59 | } 60 | 61 | // This routine loops forever 62 | void loop() 63 | { 64 | digitalWrite(led, HIGH); // Turn ON the LED 65 | delay(1000); // Wait for 1000mS = 1 second 66 | digitalWrite(led, LOW); // Turn OFF the LED 67 | delay(1000); // Wait for 1 second 68 | } 69 | ``` 70 | 71 | Control LEDs over the 'net 72 | === 73 | 74 | ![Two LED setup]({{assets}}/images/breadboard-two-leds.jpg) 75 | 76 | Now that we know how to blink an LED, how about we control it over the Internet? This is where the fun begins. 77 | 78 | Lets hook up two LEDs this time. 79 | 80 | Here is the algorithm: 81 | 82 | - Set up the pins as outputs that have LEDs connected to them 83 | - Create and register a Spark function ( this gets called automagically when you make an API request to it) 84 | - Parse the incoming command and take appropriate actions 85 | 86 | ```cpp 87 | // ----------------------------------- 88 | // Controlling LEDs over the Internet 89 | // ----------------------------------- 90 | 91 | // name the pins 92 | int led1 = D0; 93 | int led2 = D1; 94 | 95 | // This routine runs only once upon reset 96 | void setup() 97 | { 98 | //Register our Spark function here 99 | Spark.function("led", ledControl); 100 | 101 | // Configure the pins to be outputs 102 | pinMode(led1, OUTPUT); 103 | pinMode(led2, OUTPUT); 104 | 105 | // Initialize both the LEDs to be OFF 106 | digitalWrite(led1, LOW); 107 | digitalWrite(led2, LOW); 108 | } 109 | 110 | 111 | // This routine loops forever 112 | void loop() 113 | { 114 | // Nothing to do here 115 | } 116 | 117 | 118 | // This function gets called whenever there is a matching API request 119 | // the command string format is l, 120 | // for example: l1,HIGH or l1,LOW 121 | // l2,HIGH or l2,LOW 122 | 123 | int ledControl(String command) 124 | { 125 | int state = 0; 126 | //find out the pin number and convert the ascii to integer 127 | int pinNumber = (command.charAt(1) - '0') - 1; 128 | //Sanity check to see if the pin numbers are within limits 129 | if (pinNumber < 0 || pinNumber > 1) return -1; 130 | 131 | // find out the state of the led 132 | if(command.substring(3,7) == "HIGH") state = 1; 133 | else if(command.substring(3,6) == "LOW") state = 0; 134 | else return -1; 135 | 136 | // write to the appropriate pin 137 | digitalWrite(pinNumber, state); 138 | return 1; 139 | } 140 | ``` 141 | 142 | --- 143 | 144 | The API request will look something like this: 145 | 146 | ```json 147 | POST /v1/devices/{DEVICE_ID}/led 148 | 149 | # EXAMPLE REQUEST IN TERMINAL 150 | # Core ID is 0123456789abcdef 151 | # Your access token is 123412341234 152 | curl https://api.spark.io/v1/devices/0123456789abcdef/led \ 153 | -d access_token=123412341234 \ 154 | -d params=l1,HIGH 155 | ``` 156 | 157 | Note that the API endpoint is 'led', not 'ledControl'. This is because the endpoint is defined by the first argument of Spark.function(), which is a string of characters, rather than the second argument, which is a function. 158 | 159 | To better understand the concept of making API calls to your Core over the cloud checkout the [Cloud API reference.](/#/api) 160 | 161 | Measuring the temperature 162 | === 163 | 164 | ![Read Temperature]({{assets}}/images/breadboard-temp-sensor.jpg) 165 | 166 | We have now learned how to send custom commands to the Core and control the hardware. But how about reading data back from the Core? 167 | 168 | In this example, we will hook up a temperature sensor to the Core and read the values over the internet with a web browser. 169 | 170 | We have used a widely available analog temperature sensor called TMP36 from Analog Devices, and is the temperature sensor that comes with your Spark Maker Kit! You can download the [datasheet here.](http://www.analog.com/static/imported-files/data_sheets/TMP35_36_37.pdf) 171 | 172 | Notice how we are powering the sensor from 3.3V\* pin instead of the regular 3.3V. This is because the 3.3V\* pin gives out a (LC) clean filtered voltage, ideal for analog applications like these. If the readings you get are noisy or inconsistent, add a 0.01uF (10nF) ceramic capacitor between the analog input pin (in this case, A7) and GND as shown in the set up. Ideally, the sensor should be placed away from the Core so that the heat dissipated by the Core does not affect the temperature readings. 173 | 174 | ```C++ 175 | // ----------------- 176 | // Read temperature 177 | // ----------------- 178 | 179 | // Create a variable that will store the temperature value 180 | double temperature = 0.0; 181 | 182 | void setup() 183 | { 184 | // Register a Spark variable here 185 | Spark.variable("temperature", &temperature, DOUBLE); 186 | 187 | // Connect the temperature sensor to A7 and configure it 188 | // to be an input 189 | pinMode(A7, INPUT); 190 | } 191 | 192 | void loop() 193 | { 194 | int reading = 0; 195 | double voltage = 0.0; 196 | 197 | // Keep reading the sensor value so when we make an API 198 | // call to read its value, we have the latest one 199 | reading = analogRead(A7); 200 | 201 | // The returned value from the Core is going to be in the range from 0 to 4095 202 | // Calculate the voltage from the sensor reading 203 | voltage = (reading * 3.3) / 4095; 204 | 205 | // Calculate the temperature and update our static variable 206 | temperature = (voltage - 0.5) * 100; 207 | } 208 | ``` 209 | 210 | --- 211 | 212 | The API request will look something like this: 213 | 214 | ```json 215 | GET /v1/devices/{DEVICE_ID}/temperature 216 | 217 | # EXAMPLE REQUEST IN TERMINAL 218 | # Core ID is 0123456789abcdef 219 | # Your access token is 123412341234 220 | curl -G https://api.spark.io/v1/devices/0123456789abcdef/temperature \ 221 | -d access_token=123412341234 222 | ``` 223 | -------------------------------------------------------------------------------- /src/content/fr/connect.md: -------------------------------------------------------------------------------- 1 | Connecter votre Core 2 | === 3 | 4 | 5 | 6 | La méthode la plus simple pour connecter votre Spark Core au Wi-Fi est d'utiliser l'application mobile Spark pour iPhone ou Android. Mais si cette méthode ne fonctionne pas pour vous ou bien que vous n'ayez pas de téléphone iOS/Android, il existe d'autres méthodes. 7 | 8 | Pour toutes les méthodes suivantes, le Spark Core doit être en mode « d'écoute », qui se caractérise par le clignotement de sa LED bleue. 9 | 10 | 11 | 12 | Le Core démarre en mode d'écoute par défaut, donc si votre Core est tout neuf, il devrait directement se mettre en mode d'écoute. Dans le cas contraire, appuyez sur le bouton mode pendant trois secondes. 13 | 14 | ## Smart Config avec l'application Spark 15 | 16 | 17 | 18 | Une fois que vous avez téléchargé l'application Spark Core depuis l'App Store ou Google Play, vous devriez créer un compte. Après cette étape, il vous sera demandé de connecter votre Core en utilisant un processus appelé Smart Config. Si votre Core possède un connecter u.FL, vous devez connecter une antenne externe avant de lancer Smart Config. *NOTE : Votre téléphone doit être connecté au réseau Wi-Fi auquel vous souhaitez connecter votre Core.* L'application remplira automatiquement le champ SSID avec le nom du réseau auquel votre téléphone est connecté. Saisissez ensuite votre mot de passe Wi-Fi, et appuyez sur « Connect ». 19 | 20 | 21 | 22 | Smart Config peut prendre jusqu'à une minute, donc soyez patient. Le plus proche est votre téléphone de votre Spark Core, le plus rapidement il se connectera. Une fois que le Core capte le signal, il passera par la séquence lumineuse suivante : 23 | 24 | - **Bleu fixe** : Identifiants capturés 25 | - **Clignotements verts** : Connexion au réseau Wi-Fi 26 | - **Clignotements cyans** : Connexion au Spark Cloud 27 | - **Pulsations cyans** : Connecté au Spark Cloud 28 | 29 | 30 | 31 | Une fois que le Spark Core sera connecté, votre téléphone « réclamera » ce dernier et le rattachera à votre compte. Ensuite, il ne vous restera plus qu'à donner un nom à votre Core. Si vous n'êtes pas certain, vous pouvez confirmer que le processus de réclamation s'est terminé avec succès en vous connectant sur l'[IDE Spark](https://www.spark.io/build) et en cliquant sur l'icône « Cores » en bas de la page. Votre Core est dans la liste ? Bravo ! Tous est pour le mieux en ce bas monde. 32 | 33 | *NOTE: Le Core **DOIT** être connecté (pulsations cyan) pour que le processus de réclamation fonctionne. Si le Spark Core a été réclamé par quelqu'un d'autre, l'application ne le reconnaitra pas. Si vous devez transférer votre Spark Core vers un autre compte, envoyez nous un mail à [hello@spark.io](mailto:hello@spark.io).* 34 | 35 | 36 | 37 | Si vous connectez plusieurs Cores, vous passerez par ce processus de nommage pour chaque Core. Vous saurez qui est qui grâce au « signal arc en ciel ». 38 | 39 | 40 | 41 | Une fois que vous avez fini de nommer vos Cores, vous pouvez les contrôler à l'aide de Tinker ! Essayez *digitalWrite* sur D7 pour allumer la LED utilisateur. 42 | 43 | ## Smart Config avec l'application TI 44 | 45 | Smart Config avec l'application pour Texas Instrument CC3000 est similaire au processus ci-dessus, même si vous n'avez pas besoin de compte Spark, et que TI propose aussi une applet Java qui peut fonctionner sur Mac, Windows ou Linux. 46 | 47 | Suivez les instructions sur le site de Texas Instruments 48 | 49 | [CC3000 Smart Config @ Texas Instruments](http://processors.wiki.ti.com/index.php/CC3000_Smart_Config) 50 | 51 | La seule chose différente est que vous aurez besoin d'activer la clé AES optionnelle et saisir `sparkdevices2013`. 52 | 53 | *NOTE : L'application Android de TI n'est pas disponible sur Google Play. Vos devrez la télécharger vous même depuis leur site, et charger l'apk vous même.* 54 | 55 | ## Connexion via USB 56 | 57 | Vous pouvez aussi connecter le Spark Core à votre réseau Wi-Fi à l'aide d'une communication Série par USB. *NOTE : Ceci fonctionne uniquement quand le Spark Core est en mode d'écoute (comprendre : la LED RVB clignote en bleu)*. 58 | 59 | Tout d'abord, vous devez télécharger une application de terminal série. 60 | 61 | Pour les utilisateurs de __Windows__, nous vous recommandons [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/). 62 | Vous devez aussi installer les pilotes Windows : 63 | 64 | 65 | [Pilotes Windows pour Spark Core >](https://s3.amazonaws.com/spark-website/Spark.zip) 66 | 67 | [CoolTerm](http://freeware.the-meiers.org/) fourni aussi une interface graphique agréable. 68 | ![Paramétrages CoolTerm]({{assets}}/images/coolterm-settings.png) 69 | ![Configuration CoolTerm]({{assets}}/images/coolterm-setup.png) 70 | 71 | Pour les utilisateurs __Mac__, tant CoolTerm que screen fonctionnent. 72 | 73 | Pour l'utilisation de __Linux__ en ligne de commande, [GNU Screen](https://www.gnu.org/software/screen/) fonctionne très bien. 74 | (Avec OS X, la ligne de commande devrait ressembler à `screen /dev/cu.usbmodem1411 9600`. 75 | Avec Ubuntu, ça ressemble à `screen /dev/ttyACM0 9600`. L'emplacement du périphérique peut être différent, fouillez dans le répertoire `/dev`si vous ne le trouvez pas immédiatement) 76 | 77 | __Comment faire__ 78 | 79 | Branchez votre Spark Core à votre ordinateur via USB. Quand le Spark Core est en mode d'écoute, ouvrez un port série USB en utilisant les paramètres standards, à savoir : 80 | 81 | - Baudrate: 9600 82 | - Data Bits: 8 83 | - Parity: none 84 | - Stop Bits: 1 85 | 86 | Une fois que la connexion série est ouverte, vous avez deux commandes à votre disposition en tapant soit **w** ou **i** sur le clavier. Voici ce qu'elles font : 87 | 88 | - **w** : Configure les identifiants de votre réseau Wi-Fi (SSID et mot de passe) 89 | - **i** : (« i » comme identifier) Affiche l'ID du Spark Core 90 | 91 | **NOTE :** Si vous connectez votre Core via USB pour la première fois, vous devrez aussi *réclamer* manuellement votre Core pour le connecter à votre compte. Veuillez jeter un œil à la section plus bas nommée [Réclamer votre Core](/#/connect/réclamer-votre-core) 92 | 93 | ## À venir : Identifiants en codés en dur 94 | 95 | À l'heure actuelle, il n'existe pas de mécanisme pour coder en dur votre SSID et mot de passe dans le firmware du Spark Core. Nous y travaillons ! 96 | 97 | Réclamer votre Core 98 | === 99 | 100 | Une fois que votre Core est connecté, il doit être *réclamé* afin de pouvoir être associé à votre compte. C'est que qui vous permet, et uniquement vous, de contrôler votre Core. 101 | 102 | Si vous utilisez l'application mobile pour configurer votre Core, il devrait être automatiquement réclamé. Cependant, si vous connectez votre Core via USB, ou que que le processus de réclamation a échoué, vous pouvez le réclamer manuellement. 103 | 104 | Tout d'abord, vous devez obtenir l'ID de votre Core. Vous pouvez faire ça en ouvrant une connexion série vers le Core et en appuyant sue la touche **i** (voyez ci-dessus les instructions pour la connexion série via USB). Ça devrait vous afficher un numéro comme suit : 105 | 106 | # Exemple d'ID de Core 107 | 55ff68064989495329092587 108 | 109 | --- 110 | 111 | Puis accédez à [Spark Build](https://www.spark.io/build) et cliquez sur l'icône « Cores ». Cliquez sur le bouton affichant « Add a Core », et entrez votre ID dans le champ texte. 112 | 113 | Nous mettrons à disposition un outil en ligne de commande qui simplifiera le processus. Restez à l'écoute ! 114 | 115 | 116 | APPENDICE 117 | === 118 | 119 | ## Mode DFU (Device Firmware Upgrade / Mise à jour du firmware du périphérique) 120 | 121 | Si vous souhaitez programmer un Core avec un firmware personnalisé via USB, vous devrez utiliser ce mode. Ce mode déclenche le bootloader embarqué qui accepte un binaire de firmware via dfu-utils. 122 | 123 | Procédure: 124 | 125 | Enfoncez les deux boutons, puis relâchez le bouton RST, tout en laissant enfoncé le bouton MODE. Relâchez le bouton MODE dès que la LED commence à clignoter en jaune. Le Core est maintenant en mode DFU. 126 | 127 | 128 | 129 | 130 | 131 | ## Remise au paramètres d'usine 132 | 133 | Une remise au paramètres d'usine restaure le firmware sur le Core avec l'application Tinker et supprime toutes vos informations Wi-Fi. 134 | 135 | Procédure: 136 | 137 | La procédure est la même que celle décrite ci-dessus (mode DFU), mais dans ce cas vous devez continuer d'appuyer sur le bouton MODE jusqu'à ce que le Core passe du clignotement en jaune au clignotement en blanc. Puis relâchez le bouton. Le Core devrait commencer à clignoter en bleu une fois la remise aux paramètres d'usine terminée. 138 | 139 | **Note :** La vidéo ci-dessous est la suite de la vidéo précédente (mode DFU). 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/content/hardware.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Datasheet 3 | title: Hardware datasheet 4 | order: 9 5 | --- 6 | 7 | Spark Core Datasheet 8 | === 9 | 10 | Subsystems 11 | --- 12 | 13 | ### Microcontroller 14 | 15 | ![STM32]({{assets}}/images/core-stm32.jpg) 16 | 17 | Spark Core v1.0 uses the STM32F103CB - ARM 32-bit Cortex M3 based - microcontroller for its brain power. You can download the datasheet [here.](https://github.com/spark/core/blob/master/Datasheets/ST_STM32F103CB.pdf) 18 | 19 | Some of its key features are as follows: 20 | 21 | - ARM 32-bit Cortex™-M3 CPU Core 22 | - 72Mhz operating frequency, 1.25 DMIPS/MHz (Dhrystone 2.1) 23 | - 128KB of Flash memory 24 | - 20KB of SRAM 25 | - 12 bit ADC 26 | - USB 2.0 full-speed interface 27 | - USART, SPI and I2C interfaces 28 | - JTAG Debug mode 29 | 30 | 31 | 32 | ### Wi-Fi module 33 | 34 | ![CC3000]({{assets}}/images/core-cc3000.jpg) 35 | 36 | Core v1.0 uses TI's CC3000 module for the WiFi communications. 37 | 38 | Some of the key features of the CC3000 module are as follows: 39 | 40 | - IEEE 802.11 b/g compliant 41 | - Radio Performance 42 | - TX power: +18.0 dBm at 11 Mbps, CCK 43 | - RX sensitivity: – 88 dBm, 8% PER, 11 Mbps 44 | - Operating temperature: – 20° C to 70° C 45 | - Wireless security subsystem 46 | - WEP 47 | - WPA Personal 48 | - WPA2 Personal 49 | - FCC, IC, and CE certified with a chip antenna 50 | - SPI host interface 51 | 52 | The datasheet is available [here.](http://www.ti.com/lit/ds/symlink/cc3000.pdf) 53 | 54 | 55 | ### External FLASH 56 | 57 | ![External Flash]({{assets}}/images/core-flashchip.jpg) 58 | 59 | In addition to having 128KB of internal flash memory for storing the firmware, the Core also features an external SPI based flash memory chip - [SST25VF016B](https://github.com/spark/core/blob/master/Datasheets/MicrochipTech_SST25VF016B-75-4I-S2AF-T.pdf?raw=true). This memory space (a total of 2MB) is used to store the factory reset firmware, a back up firmware, a copy of the firmware sent during Over The Air (OTA) update and the keys. Part of the space is also available to the user who can use it to store log data, user parameters, etc. A detailed description of the memory mapping can be found further down this document in the [memory mapping section.](#spark-core-datasheet-memory-mapping) 60 | 61 | Since the flash memory is non-volatile, it retains the data even after turning off the power. According to the manufacturer of the chip, the data retention of this memory is greater than 100 years, which we reckon should be good enough for now. Also, note that the maximum read-write endurance is limited to 100,000 cycles. meh. 62 | 63 | ### Power regulator 64 | 65 | ![Power Regulator]({{assets}}/images/core-regulator.jpg) 66 | 67 | The entire Core, including all of the on board peripherals run at 3.3V DC. So, in order to power the Core from the USB port or an external power supply, we need to *downconvert* the voltage before feeding it into the Core. We went through a couple of iterations before choosing Microchip's [MCP1825S-3302E](http://ww1.microchip.com/downloads/en/devicedoc/22056b.pdf) power regulator which comfortably meets the specs. 68 | 69 | Some of its key features are: 70 | 71 | - 500mA output current 72 | - Input voltage range of 3.6 to 6.0V (for 3.3V output) 73 | - Low Dropout (LDO) voltage of 210mV at 500mA 74 | - SOT-223 package that sits nicely on the other side of the USB connector. The connector also acts as an additional heat sink. 75 | - Short Circuit Current Limiting and Overtemperature Protection 76 | 77 | This means, you can power the Core via the USB port or via the VIN pin from an external power supply that can range from 3.6V to 6.0V DC. Ideal sources of power can be: 3.6V LiPo battery, 4AA battery pack, backup USB battery or an USB wall charger. 78 | 79 | ![Powering the Core]({{assets}}/images/core-power1.jpg) 80 | 81 | ### RF circuit 82 | 83 | ![RF Circuit]({{assets}}/images/core-rf.jpg) 84 | 85 | The RF circuit is probably where we spent the most time on during hardware design. RF design is like voodoo black magic, so we sought guidance from the industry experts before finalizing the component values and placement. 86 | 87 | You can download a copy of the RF test report [here.]({{assets}}/images/core-rf-test-report.pdf) 88 | 89 | Pins and I/O 90 | --- 91 | ![Spark Pinout]({{assets}}/images/spark-pinout.png) 92 | 93 | The Spark Core offers a total 18 I/O pins to the user: `D0 to D7`, `A0 to A7` and two pins that are preset to serial - `TX` and `RX`. All of these I/O pins run at *3.3V* and the user should keep this in mind before attaching any external peripherals to them. The only exception to this are the following pins that are tolerant to 5V inputs: 94 | 95 | `D0, D1, D3, D4, D5, D6 and D7` 96 | 97 | [Click here to view a larger pinout diagram]({{assets}}/images/spark-pinout.png) 98 | 99 | ### Digital pins 100 | 101 | Each pin on the Core can either be configured as input (with or without pull-up or pull-down) or as output (push-pull or open-drain) using the [pinMode()](firmware/#setup-pinmode) function. 102 | 103 | 104 | After setting them up, the user can then write to or read from the pins using [digitalWrite()](firmware/#i-o-digitalwrite) and [digitalRead()](firmware/#i-o-digitalread) functions respectively. 105 | 106 | Each of these pins can individually source/sink a maximum of 20mA. In the input mode, the user can activate internal pull-up or pull-down resistors (typically equal to 40K ohms). By default these are deactivated. 107 | 108 | ### Analog Inputs 109 | 110 | Pins A0 to A7 can be set up as analog inputs and can measure voltages of upto 3.3V and are internally referenced to VDD. The user can read the pins using [analogRead()](firmware/#i-o-analogread) function which returns a 12bit value. 111 | 112 | ### Analog Outputs 113 | 114 | This term is misleading and misused but is widely adopted in the Arduino community. The pins that are set to output an analog value don't actually output an analog voltage but rather produce a PWM signal whose duty cycle can be varied thus varying the total average power of the signal. On the Core, the PWM signals have a resolution of 8 bits and run at a frequency of 500Hz. 115 | 116 | Having said that, the user can send analog values to the pins using the function [analogWrite().](firmware/#i-o-analogwrite) 117 | 118 | This feature is only available on the following pins: `A0, A1, A4, A5, A6, A7, D0 and D1.` 119 | 120 | ### Serial (UART) 121 | 122 | ![Hardware USART]({{assets}}/images/core-pin-usart.jpg) 123 | 124 | The Core features three serial ports. The first one is a CDC (Communications Device Class) available over the USB port. When configured, it will show up as a virtual COM port on the computer. (usage: `Serial.begin(9600);`) 125 | 126 | The second one is a hardware USART available via the TX and RX pins on the Core. (usage: `Serial1.begin(9600);`) 127 | 128 | The third one is a hardware USART available via the D1(Tx) and D0(Rx) pins on the Core. (usage: `Serial2.begin(9600);`) 129 | 130 | Configuration and use of all of these serial ports is described in the [serial functions.](/firmware/#communication-serial) 131 | 132 | **NOTE:** Please take into account that the voltage levels on these pins runs at 0V to 3.3V and should not be connected directly to a computer's RS232 serial port which operates at +/- 12V and can damage the Core. 133 | 134 | ### SPI 135 | 136 | ![SPI]({{assets}}/images/core-pin-spi.jpg) 137 | 138 | The Serial Peripheral Interface is available on pins: 139 | 140 | - `A2: SS (Slave Select)` 141 | - `A3: SCK (Serial Clock)` 142 | - `A4: MISO (Master In Slave Out)` 143 | - `A5: MOSI (Master Out Slave In)` 144 | 145 | **NOTE:** All of these pins run at 3.3V logic levels. 146 | 147 | ### I2C 148 | 149 | ![I2C]({{assets}}/images/core-pin-i2c.jpg) 150 | 151 | I2C communication pins are multiplexed with the standard GPIO pins D0 and D1. 152 | 153 | - `D0: SDA (Serial Data Line)` 154 | - `D1: SCL (Serial Clock)` 155 | 156 | Both of these pins run at 3.3V logic level but *are* tolerant to 5V inputs. 157 | 158 | ### JTAG 159 | 160 | ![JTAG]({{assets}}/images/core-pins-jtag.jpg) 161 | 162 | In addition to having the ability to load new firmware over USB and WiFi, the users also have direct access to the STM32 chip via the JTAG channel. In order to do this, you will need a JTAG shield and a JTAG programmer. You could make your own JTAG shield or buy one from us. Currently we have only tested the [ST-LINK/V2](http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168) programmer successfully. 163 | 164 | The hardware files for the JTAG shield are available [here.](https://github.com/spark/shields/tree/master/Programmer%20Shield) 165 | 166 | Memory mapping 167 | --- 168 | 169 | ###Internal Flash Memory Map 170 | 171 | The STM32 has a total of 128KB internal flash memory which is divided into three main regions by us. Beginning at the top of the memory space is where the bootloader is saved and locked. The second region is reserved for storing system flags and the third region holds the actual user firmware. 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 |
    Memory AddressContentSize
    0x08000000Bootloader19 KB max
    0x08004C00System Flags1 KB max
    0x08005000Core Firmware Location108 KB max
    195 | 196 | ###External Flash Memory Map 197 | 198 | The external flash memory gives us an additional 2MB of storage space. This space is used to store the public and private keys, the factory reset firmware, a back-up firmware and a copy of the firmware sent Over The Air (OTA). The rest of the memory space is available to the user. 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 |
    Memory AddressContentSize
    0x00000Reserved4KB
    0x01000Public Key294 Bytes - 4KB max
    0x02000Private Key612 Bytes
    0x20000Factory Reset Firmware Location128 KB max
    0x40000BackUp Firmware Location128 KB max
    0x60000OTA Firmware Location128 KB max
    0x80000End of OTA Firmware
    NOT USED
    0x200000End of Flash Memory
    249 | 250 | Electrical characteristics 251 | --- 252 | 253 | ### Power 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 |
    ParameterMinMax
    Input Voltage (at VIN) 3.6 V 6.0 V
    Total Current Consumption50mA300mA
    Current Consumption in Deep Sleep3.2 μA -
    Current per I/O pin8mA20mA
    282 | 283 | ### RF 284 | 285 | ![S11 Chart]({{assets}}/images/core-s11-chart.png) 286 | 287 | With the on board chip antenna, the peak return loss (S11) has been measured and verified to be in the excess of 20dB. 288 | 289 | The transmission loss for the u.FL connector has been measured to be approximately 0.5 to 0.75dB. 290 | 291 | Types of Cores 292 | --- 293 | 294 | ![Antenna Options]({{assets}}/images/chip-ufl.jpg) 295 | 296 | Currently the Core is available in two flavors. With an on-board chip antenna or an uFL connector to connect an external antenna. 297 | 298 | #### Chip Antenna 299 | 300 | 301 | This version of the Core comes with an on board chip antenna that gives a signal strength similar to a mobile phone. In most cases, a simple plastic enclosure will not affect the signal strength of the chip antenna. 302 | 303 | #### uFL Connector 304 | 305 | If you want to improve the signal strength of the Core, you can connect an external antenna with the help of the [uFL connector](http://en.wikipedia.org/wiki/Hirose_U.FL). Most antennas that are designed to operate at 2.4GHz or are WiFi rated will do the job. You can also make your own [cantenna](https://community.spark.io/t/extending-the-core-wifi-range-with-a-cantenna/1357)! 306 | 307 | 308 | Physical layout 309 | --- 310 | ![DIMENSIONS]({{assets}}/images/core-dim.jpg) 311 | 312 | The header pins on the Core are spaced at an interval of 0.1", which is the standard pitch size for proto-boards and breadboards. The physical layout of the Core was inspired from the [Arduino Pro Mini](http://arduino.cc/en/Main/ArduinoBoardProMini) board. 313 | 314 | Mechanical drawings of the Core are available [here.](https://github.com/spark/core/blob/master/PDFs/core-mechanical-drawing-v1.pdf) 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 |
    ParameterValue
    Length1.47"
    Width0.8"
    Height0.5"
    Weight14 grams
    338 | -------------------------------------------------------------------------------- /src/content/it/examples.md: -------------------------------------------------------------------------------- 1 | Esempi 2 | ======= 3 | 4 | Qui troverete diversi esempi per cominciare a lavorare con il vostro nuovo Spark Core! 5 | 6 | Lampeggiare un LED 7 | === 8 | 9 | ![One LED illustration]({{assets}}/images/annotated-example1.jpg) 10 | 11 | Far lampeggiare un LED è il programma di esempio ["Hello World"](http://en.wikipedia.org/wiki/Hello_world_program) per il mondo dei microprocessori. È un modo carino per scaldarsi e iniziare il viaggio nel modo dell'hardware embedded. 12 | 13 | Per questo esempio avete bisogno di uno Spark Core (già!), una Breadboard, un LED, una resistenza (vedremo dopo di trovarne il valore) e un cavo USB. 14 | 15 | Collegate il tutto come sull'immagine a fianco. Il LED è connesso con il pin D0 del Core. Il pin positivo del LED (quello più lungo) è collegato al pin D0 e quello negativo (più corto) è connesso a massa tramite una resistenza. 16 | 17 | ![One LED setup]({{assets}}/images/breadboard-one-led.jpg) 18 | 19 | Un momento, qual'è il valore della resistenza? 20 | 21 | *Ecco come possiamo trovarlo:* 22 | 23 | Secondo la [legge di Ohm](http://it.wikipedia.org/wiki/Legge_di_Ohm) : Tensione = Corrente x Resistenza 24 | 25 | Quindi Resistenza = Tensione / Corrente 26 | 27 | Nel nostro caso, la tensione di uscita del Core è 3.3V ma il LED (normalmente) ha una caduta di tensione di ca. 2.0V. La tensione effettiva è quindi: 28 | 29 | 3.3V - 2.0V = 1.3V 30 | 31 | La corrente necessaria per far illuminare un LED varia tra 2mA a 20mA. Più corrente, più luminosità. Generalmente è una buona idea di usare il LED al suo limite inferiore per prolungarne la vita. Sceglieremo una corrente di 5mA. 32 | 33 | Quindi, Resistenza = 1.3V/ 5mA = 260 Ohms 34 | 35 | **NOTA:** Visto che ci sono talmente tanti valori della caduta di tensione dei LEDs a dipendenza dal tipo, grandezza, colore, produttore, ecc. potrete usare con successo dei valori tra 220 Ohms e 1K Ohms. 36 | 37 | Nell'immagine abbiamo usato una resistenza da 1K (Marrone Nero Rosso) 38 | 39 | Adesso il programma: 40 | 41 | ```cpp 42 | // Programma per far lampeggiare un LED collegato al pin D0 43 | // dello Spark Core. 44 | 45 | // Diamo il nome led al pin D0 46 | int led = D0; 47 | 48 | // Questa routine gira una sola volta dopo il reset 49 | void setup() 50 | { 51 | // Inizializzare il pin D0 come output 52 | pinMode(led, OUTPUT); 53 | } 54 | 55 | // Questa routine gira per sempre 56 | void loop() 57 | { 58 | digitalWrite(led, HIGH); // Accendi il LED 59 | delay(1000); // Aspetta per 1000mS = 1 secondo 60 | digitalWrite(led, LOW); // Spegni il LED 61 | delay(1000); // Aspetta per un secondo 62 | } 63 | ``` 64 | 65 | Controllare i LEDs via rete 66 | === 67 | 68 | ![Two LED setup]({{assets}}/images/breadboard-two-leds.jpg) 69 | 70 | Adesso che sappiamo come far lampeggiare un LED, come sarebbe controllarlo via Internet? Ecco dove comincia il divertimento. 71 | 72 | Questa volta colleghiamo due LEDs. 73 | 74 | Questo è l'algoritmo: 75 | 76 | - Definire i pins che hanno un LED attaccato come outpu 77 | - Creare e registrare una funzione Spark (questa viene chiamata automaticamente quando fate una richiesta API) 78 | - Analizzare il comando in entrata e agire di conseguenza 79 | 80 | ```cpp 81 | // ----------------------------------- 82 | // Controllare dei LEDs via Internet 83 | // ----------------------------------- 84 | 85 | // nome dei pins 86 | int led1 = D0; 87 | int led2 = D1; 88 | 89 | // Questa routine gira una sola volta dopo il reset 90 | void setup() 91 | { 92 | //Registrare la funzione Spark 93 | Spark.function("led", ledControl); 94 | 95 | // Configurare i pins come output 96 | pinMode(led1, OUTPUT); 97 | pinMode(led2, OUTPUT); 98 | 99 | // Inizializzare entrambi i LEDs come spenti 100 | digitalWrite(led1, LOW); 101 | digitalWrite(led2, LOW); 102 | } 103 | 104 | 105 | // Questa routine gira per sempre 106 | void loop() 107 | { 108 | // Niente da fare qui 109 | } 110 | 111 | 112 | // Questa funzione viene chiamata ogni volta che c'è una richiesta API corrispondente 113 | // il formato dello string di comando è l, 114 | // per esempio: l1,HIGH o l1,LOW 115 | // l2,HIGH o l2,LOW 116 | 117 | int ledControl(String command) 118 | { 119 | int state = 0; 120 | //trovare il numero di pin e convertire il valore ascii a integer 121 | int pinNumber = (command.charAt(1) - '0') - 1; 122 | //Controllare se il numero di pin è nei limiti 123 | if (pinNumber < 0 || pinNumber > 1) return -1; 124 | 125 | // trovare lo stato del led 126 | if(command.substring(3,7) == "HIGH") state = 1; 127 | else if(command.substring(3,6) == "LOW") state = 0; 128 | else return -1; 129 | 130 | // scrivere sul pin appropriato 131 | digitalWrite(pinNumber, state); 132 | return 1; 133 | } 134 | ``` 135 | 136 | --- 137 | 138 | La richiesta API dovrebbe essere qualcosa del genere: 139 | 140 | ```json 141 | POST /v1/devices/{DEVICE_ID}/led 142 | 143 | # ESEMPIO DI RICHIESTA DA TERMINAL 144 | # Core ID è 0123456789abcdef01234567 145 | # Il vostro access token è 1234123412341234123412341234123412341234 146 | curl https://api.spark.io/v1/devices/0123456789abcdef01234567/led \ 147 | -d access_token=1234123412341234123412341234123412341234 \ 148 | -d params=l1,HIGH 149 | ``` 150 | 151 | Notate che la fine della chiamata API è 'led' e non 'ledControl'. Questo perchè il punto finale è definito dal primo argomento di Spark.function(), che è una stringa di caratteri piuttosto che il secondo parametro che è invece una funzione. 152 | 153 | Per comprendere meglio il concetto delle chiamate API al Core via cloud controllate la [referenza Cloud API.](/#/api) 154 | 155 | Misurare la temperatura 156 | === 157 | 158 | ![Read Sensor]({{assets}}/images/annotated-example3.jpg) 159 | 160 | Abbiamo imparato come mandare dei comandi al Core per controllare dell'hardware. Ma come funziona invece leggere dei dati dal Core? 161 | 162 | In questo esempio collegheremo un sensore di temperatura al Core e leggeremo i valori via internet con un browser web. 163 | 164 | ![Read Temperature]({{assets}}/images/breadboard-temp-sensor.jpg) 165 | 166 | Abbiamo usato un sensore molto comune chiamato TMP36 di Analog Devices. Potete scaricare le [specifiche qui.](http://www.analog.com/static/imported-files/data_sheets/TMP35_36_37.pdf) 167 | 168 | Notate come alimentiamo il sensore dal pin 3.3V\* invece che da quello regolare 3.3V. Questo perchè il pin 3.3V\* offre una tensione pulita e filtrata, ideale per applicazioni analogiche come questa. Se le letture che ottenete sono disturbate o inconsistenti, aggiungete un condensatore in ceramica da 0.1uF (100nF) tra il pin analogico di entrata (in questo caso A0) e la massa GND come illustrato nell'immagine. 169 | 170 | ```C++ 171 | // ---------------------- 172 | // Leggere la temperatura 173 | // ---------------------- 174 | 175 | // Creare una variabile per salvare il valore della temperatura 176 | int temperature = 0; 177 | 178 | void setup() 179 | { 180 | // Registrare una variabile Spark 181 | Spark.variable("temperature", &temperature, INT); 182 | 183 | // Connettere il sensore di temperatura a A0 e configurarlo 184 | // come inputt 185 | pinMode(A0, INPUT); 186 | } 187 | 188 | void loop() 189 | { 190 | // Continuare a leggere la temperatura in modo che quando 191 | // si fa una chiamata API per leggere il valore, abbiamo l'ultimo 192 | temperature = analogRead(A0); 193 | } 194 | ``` 195 | 196 | Il valore proveniente dal Core avrà un valore tra 0 e 4095. Lo si può 197 | facilmente convertire alla temperatura attuale usando la seguente formula: 198 | 199 | ``` 200 | tensione = (lettura sensore x 3.3)/4095 201 | Temperatura (in Celsius) = (tensione - 0.5) X 100 202 | ``` 203 | 204 | --- 205 | 206 | La richiesta API è qualcosa del genere: 207 | 208 | ```json 209 | GET /v1/devices/{DEVICE_ID}/temperature 210 | 211 | # ESEMPIO DI RICHIESTA DA TERMINAL 212 | # Core ID è 0123456789abcdef01234567 213 | # Il vostro access token è 1234123412341234123412341234123412341234 214 | curl -G https://api.spark.io/v1/devices/0123456789abcdef01234567/temperature \ 215 | -d access_token=1234123412341234123412341234123412341234 216 | ``` 217 | 218 | Comunicazione locale 219 | === 220 | 221 | Adesso immaginate di voler controllare il vostro Core localmente, 222 | così create una semplice applicazione server alla quale il Core si collega 223 | direttamente. Un enigma da risolvere è il fatto che non conoscete in 224 | anticipo l'indirizzo IP del vostro Core o del computer dove girerà il server. 225 | Come possono fare il Core ed il Server a scoprirsi a vicenda? 226 | 227 | In questo esempio registreremo una funzione Spark per passare l'indirizzo IP 228 | del server al Core. Dopo aver stabilito la connessione locale, saremo in grado 229 | di controllare il Core senza passare dal Cloud. 230 | 231 | --- 232 | 233 | ```C++ 234 | TCPClient client; 235 | ``` 236 | 237 | Prima costruiamo il client che si collegherà col nostro server locale. 238 | 239 | --- 240 | 241 | ```C++ 242 | void ipArrayFromString(byte ipArray[], String ipString) { 243 | int dot1 = ipString.indexOf('.'); 244 | ipArray[0] = ipString.substring(0, dot1).toInt(); 245 | int dot2 = ipString.indexOf('.', dot1 + 1); 246 | ipArray[1] = ipString.substring(dot1 + 1, dot2).toInt(); 247 | dot1 = ipString.indexOf('.', dot2 + 1); 248 | ipArray[2] = ipString.substring(dot2 + 1, dot1).toInt(); 249 | ipArray[3] = ipString.substring(dot1 + 1).toInt(); 250 | } 251 | ``` 252 | 253 | Dopo abbiamo bisogno di una funzione che trasformi lo string dell'indirizzo IP 254 | in un array di 4 bytes necessario al client TCP. 255 | 256 | Lavoriamo progressivamente attraverso lo string, salvando le posizioni dei punti 257 | e dei substring numerici tra di essi. 258 | 259 | --- 260 | 261 | ```C++ 262 | int connectToMyServer(String ip) { 263 | byte serverAddress[4]; 264 | ipArrayFromString(serverAddress, ip); 265 | 266 | if (client.connect(serverAddress, 9000)) { 267 | return 1; // successfully connected 268 | } else { 269 | return -1; // failed to connect 270 | } 271 | } 272 | ``` 273 | 274 | Questa è la funzione Spark che registreremo. 275 | Come tutte le funzioni Spark necessita di un parametro String e ritorna un integer. 276 | Riserviamo un array di 4 bytes per l'indirizzo IP, poi chiamiamo `ipArrayFromString()` 277 | per convertire lo String in un array. 278 | 279 | Dopo questo, chiamiamo semplicemente `client.connect()` con l'indirizzo appena ricevuto! 280 | Molto semplice! 281 | 282 | --- 283 | 284 | ```C++ 285 | void setup() { 286 | Spark.function("connect", connectToMyServer); 287 | 288 | for (int pin = D0; pin <= D7; ++pin) { 289 | pinMode(pin, OUTPUT); 290 | } 291 | } 292 | ``` 293 | 294 | In `setup()` abbiamo solo due cose da fare: 295 | 296 | * Registrare la funzione Spark 297 | * Mettere D0–D7 come pins di output 298 | 299 | --- 300 | 301 | ```C++ 302 | void loop() { 303 | if (client.connected()) { 304 | if (client.available()) { 305 | char pin = client.read() - '0' + D0; 306 | char level = client.read(); 307 | if ('h' == level) { 308 | digitalWrite(pin, HIGH); 309 | } else { 310 | digitalWrite(pin, LOW); 311 | } 312 | } 313 | } 314 | } 315 | ``` 316 | 317 | In `loop()` prima controlliamo che il client sia connesso al server. 318 | Se non lo è, non facciamo niente. 319 | 320 | Se il client è connesso, controlliamo se sono stati ricevuti dei comandi via 321 | comunicazione locale. Se non ricevuti, di nuovo, non facciamo niente. 322 | 323 | Se siamo *connessi* e abbiamo *ricevuto un comando* usiamo il comando 324 | per eseguire un `digitalWrite()`. 325 | 326 | [Esempio di server e firmware su github >](https://github.com/spark/local-communication-example) 327 | 328 | texting il core 329 | === 330 | 331 | **Prossimamente!** 332 | 333 | un bottone internet 334 | === 335 | 336 | **Prossimamente!** 337 | -------------------------------------------------------------------------------- /src/content/start.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Start 3 | title: Getting started 4 | order: 0 5 | --- 6 | 7 | Getting started 8 | ===== 9 | 10 | ### What's in the box 11 | 12 | ![Spark Core in box]({{assets}}/images/core-in-box.jpg) 13 | 14 | Congratulations on being the owner of a brand new Spark Core! Go ahead, open the box, and let's talk about what you see. Your box should include: 15 | 16 | - *(1) Spark Core* The reason you bought it! 17 | - *(1) Breadboard* A breadboard makes it easy to wire components to the Core without soldering. See [Wikipedia](http://en.wikipedia.org/wiki/Breadboard) for more information. 18 | - *(1) USB cable* The included USB cable is great for powering the Spark Core and we'll cover more technical things later. 19 | 20 | 21 | ### Step 1: Power the Core 22 | 23 | ![Power the Core]({{assets}}/images/core-usb.jpg) 24 | 25 | Plug the included USB cable into the Spark Core and your computer. The Core should start blinking blue. [Have one of these u.FL connectors?](/hardware#spark-core-datasheet-types-of-cores) Make sure you connect an antenna to it now! 26 | 27 | - Not blinking blue? 28 | - Maybe it's already been configured. Hold down the MODE button until it starts blinking blue, then continue. 29 | 30 | 31 | ### Step 2: Install the App 32 | 33 | ![Spark apps]({{assets}}/images/spark-app.jpg) 34 | 35 | You can search for the mobile app named "Spark Core", or you can click one of these links: 36 | 37 | [iPhone >](https://itunes.apple.com/us/app/spark-core/id760157884) [Android >](https://play.google.com/store/apps/details?id=io.spark.core.android) 38 | 39 | Now use the app to sign up for an account! 40 | 41 | ### Step 3: Connect your Core to the Cloud! 42 | 43 | ![Smart Config]({{assets}}/images/smart-config.jpg) 44 | 45 | Make sure your phone is connected to the WiFi you want to use (it'll show up in the SSID blank on the app), then enter your password and click CONNECT! 46 | 47 | This may take a little while- but don't worry. It should go through the following colors: 48 | 1. **Blinking blue**: Listening for Wi-Fi credentials 49 | 2. **Solid blue**: Getting Wi-Fi info from app 50 | 3. **Blinking green**: Connecting to the Wi-Fi network 51 | 4. **Blinking cyan**: Connecting to the Spark Cloud 52 | 5. **Blinking magenta**: Updating to the newest firmware 53 | 6. **Breathing cyan**: Connected! 54 | 55 |
    56 | 57 |
    See an animation 58 | 59 | Did your phone not find any Cores? 60 | - Is it blinking blue? 61 | - Give it another go. 62 | - Is it blinking green and not getting to cyan? 63 | - Try it again by holding the MODE button on the core until it begins flashing blue, then double-check your network name and password. 64 | - Is it now breathing cyan, but the app didn't find any Cores? 65 | - Uh oh. Your Core's on the network, but it took too long. [We're going to claim your core manually.](/connect#claiming-your-core) 66 | - Something else altogether? 67 | - Give the [Connecting Your Core](/connect) page a read-through and if you're still stuck, search the [community.](http://community.spark.io) 68 | 69 | 70 | 71 | Now do things! 72 | ===== 73 | 74 | ### Blink an LED with Tinker 75 | 76 | ![Tinker]({{assets}}/images/tinker-select.jpg) 77 | 78 | The Spark app should now be on the Tinker screen, as shown to the right. 79 | 80 | Tap *D7* then _digitalWrite_ in the popup. Now when you tap the *D7* circle the tiny blue LED should turn off or on! This is because the LED shares a connection to the Core with the pin labeled D7. 81 | 82 | You could hook your own LED up to the Core on another pin and do the same thing, use digitalRead to tell that a switch has been pressed, or analogRead to see the position of a knob. 83 | 84 | You can always get Tinker back on the Core by following [these instructions](/#/tinker#tinkering-with-tinker-the-tinker-firmware) 85 | 86 | ### Put Code on Your Core 87 | 88 | ![Spark Build]({{assets}}/images/ide.png) 89 | 90 | Now let's control the blue LED using code instead of Tinker. If you [click here](http://spark.io/build) or on Build on the main page, you'll be in the IDE- where we can write code and upload it to the Core. Log in with the same email and password you used to sign up in the app, and we're off! 91 | 92 | Click "BLINK AN LED" under the Example apps title. This code turns D7 (labeled _led2_) on and off, once a second. Click the lightning bolt icon in the upper left and it will upload or "flash" this code onto your Core. You'll see a series of status colors on the main LED, and then the little blue LED blinking. Magic! 93 | 94 | You can find more info in the [Web IDE (Build) page](/#/build) 95 | 96 | Wait, what is this thing? 97 | ===== 98 | 99 | The Spark Core is a Wi-Fi development kit for internet-connected hardware. It is, in essence, the "brains" of a connected hardware product or project. 100 | 101 | The Core has on board a microcontroller, which is a small, low-cost, low-power computer that can run a single application. The microcontroller runs the show; it runs your software and tells the rest of the Core what to do. It doesn't have an Operating System the way that your computer does; it just runs a single application (often called *firmware* or an *embedded application*), which can be simple, just a few lines of code, or very complex, depending on what you want to do. 102 | 103 | Microcontrollers are particularly good at *controlling things*; hence the name. They have a set of "pins" (little spider leg type things sticking off the chip) that are called *GPIO* (General Purpose Input and Output) pins, or I/O pins. They can be hooked to sensors or buttons to listen to the world, or they can be hooked to lights and motors to act upon the world. These microcontroller's pins have been directly connected to the headers on the sides of the Core so you can easily access them; specifically, the pins labeled D0 to D7 and A0 to A7 are hooked directly to the microcontroller's GPIO pins. 104 | 105 | The microcontroller can also communicate with other chips using common protocols like *Serial* (also called UART), *SPI*, or *I2C* (also called Wire). You can then make the Core more powerful by connecting it to special-purpose chips like motor drivers or shift registers. Sometimes we'll wrap up these chips on a *Shield*, an accessory to the Core that makes it easy to extend the Core. 106 | 107 | The Core also has a Wi-Fi module, which connects it to your local Wi-Fi network in the same way that your computer or smartphone might connect to a Wi-Fi network. The Core is programmed to stay connected to the internet by default, so long as it can find and connect to a network. 108 | 109 | When the Core connects to the internet, it establishes a connection to the *Spark Cloud*. By connecting to the Cloud, the Core becomes accessible from anywhere through a simple REST API. This API is designed to make it very easy to interface with the Core through a web app or mobile app in a secure, private way, so that only you and those you trust can access the Core. 110 | 111 | ### Buttons 112 | 113 | There are two buttons on the Core: the RESET button (when holding the Core with its USB-port to the top, it's the button on the right) and the MODE button (on the left). 114 | 115 | The RESET button will put the Core in a hard reset, effectively depowering and repowering the microcontroller. This is a good way to restart the application that you've downloaded onto the Core. 116 | 117 | The MODE button serves three functions: 118 | 119 | - Hold down the MODE button for three seconds to put the Core into *Smart Config* mode to connect it to your local Wi-Fi network. The LED should start flashing blue. 120 | - Hold down the MODE button for ten seconds to clear the Core's memory of Wi-Fi networks. 121 | - Hold down the MODE button, tap on the RESET button and wait for *three seconds* to enter *Bootloader* mode, where you can reprogram the Core over USB or JTAG. Release the MODE button when you see the LED flashing yellow. If you do this by accident, simply hit RESET button to leave *Bootloader* mode. 122 | - Hold down the MODE button, tap once on the RESET button and wait for *ten seconds* to do a *Factory Reset*, where the Core is reprogrammed with the software that was installed on the Core in the factory (the Tinker application). The LED should turn white for three seconds and begin flashing quickly; when the LED switches to another color the Core has been reset. This is useful if you encounter bugs with your firmware, or if you just want to get back to Tinker. 123 | 124 | 125 | ### LEDs 126 | 127 | There are two LEDs on the Core. The big fat one in the middle is a full-color RGB LED that shows you the status of the Core's internet connection. The other small blue LED is the *user LED*; it's hooked up to D7, so when you turn the D7 pin `HIGH` or `LOW`, it turns on and off, respectively. 128 | 129 | The RGB LED could show the following states: 130 | 131 | - *Flashing blue*: Listening mode, waiting for network information. 132 | - *Solid blue*: Smart Config complete, network information found. 133 | - *Flashing green*: Connecting to local Wi-Fi network. 134 | - *Flashing cyan*: Connecting to Spark Cloud. 135 | - *High-speed flashing cyan*: Spark Cloud handshake. 136 | - *Slow breathing cyan*: Successfully connected to Spark Cloud. 137 | - *Flashing yellow*: Bootloader mode, waiting for new code via USB or JTAG. 138 | - *White pulse*: Start-up, the Core was powered on or reset. 139 | - *Flashing white*: Factory Reset initiated. 140 | - *Solid white*: Factory Reset complete; rebooting. 141 | - *Flashing magenta*: Updating firmware. 142 | - *Solid magenta*: May have lost connection to the Spark Cloud. Pressing the Reset (RST) button will attempt the update again. 143 | 144 | The RGB LED can also let you know if there were errors in establishing an internet connection. *A red LED means an error has occurred.* These errors might include: 145 | 146 | - *Two red flashes*: Connection failure due to bad internet connection. Check your network connection. 147 | - *Three red flashes*: The Cloud is inaccessible, but the internet connection is fine. Check our [Twitter feed](http://www.twitter.com/sparkdevices) to see if there have been any reported outages; if not, visit our [support page](https://www.spark.io/support) for help. 148 | - *Four red flashes*: The Cloud was reached but the secure handshake failed. Visit our [support page](https://www.spark.io/support) for help. 149 | - *Flashing yellow/red*: Bad credentials for the Spark Cloud. Contact the Spark team (hello@spark.io). 150 | 151 | ### Pins 152 | 153 | The Core has 24 pins that you can connect a circuit to. These pins are: 154 | 155 | - _VIN_: To power the Core off an unregulated power source with a voltage between 3.6V and 6V, or, if you're powering the Core over USB, this pin can be used as 5V V~OUT~ to power external components. In this case consider the current limitation imposed by your USB power source (e.g. max. 500mA for standard USB 2.0 ports). *Avoid powering the Core via USB and V~IN~ concurrently*. 156 | - _3V3_: This pin will output a regulated 3.3V power rail that can be used to power any components outside the Core. (Also, if you have your own 3.3V regulated power source, you can plug it in here to power the Core). 157 | - _3V3*_: This is a separate low-noise regulated 3.3V power rail designed for analog circuitry that may be susceptible to noise from the digital components. If you're using any sensitive analog sensors, power them from _3V3*_ instead of from _3V3_. 158 | - _!RST_: You can reset the Core (same as pressing the RESET button) by connecting this pin to GND. 159 | - _GND_: These pins are your ground pins. 160 | - _D0 to D7_: These are the bread and butter of the Spark Core: 8 GPIO (General Purpose Input/Output) pins. They're labeled "D" because they are "Digital" pins, meaning they can't read the values of analog sensors. Some of these pins have additional peripherals (SPI, JTAG, etc.) available, keep reading to find out more. 161 | - _A0 to A7_: These pins are 8 more GPIO pins, to bring the total count up to 16. These pins are just like D0 to D7, but they are "Analog" pins, which means they can read the values of analog sensors (technically speaking they have an ADC peripheral). As with the Digital pins, some of these pins have additional peripherals available. 162 | - _TX and RX_: These pins are for communicating over Serial/UART. TX represents the transmitting pin, and RX represents the receiving pin. 163 | 164 | #### PWM Pins 165 | 166 | When you want to use the `analogWrite()` function on the Core, for instance to smoothly dim the brightness of LEDs, you need to use pins that have a timer peripheral. People often call these PWM pins, since what they do is called Pulse Width Modulation. The Core has 8 PWM pins: A0, A1, A4, A5, A6, A7, D0 and D1. 167 | 168 | -------------------------------------------------------------------------------- /src/content/tinker.md: -------------------------------------------------------------------------------- 1 | --- 2 | word: Tinker 3 | title: Tinker 4 | order: 11 5 | --- 6 | 7 | Tinkering with "Tinker" 8 | ====== 9 | 10 | The Tinker app 11 | --- 12 | 13 | ![Tinker selection]({{assets}}/images/tinker.png) 14 | 15 | The Tinker section of the Spark mobile app makes it very easy to start playing with your Spark Core without writing any code. It's great for early development, and often it will do everything you need to get your project off of the ground. 16 | 17 | The app consists of 16 pins in vertical rows - 8 analog pins on the left, 8 digital pins on the right. These pins represent the 16 GPIO (General Purpose Input and Output) pins on the Spark Core, and are organized the same way. 18 | 19 | To begin, tap any of the pins. A menu will pop up showing the functions that pin has available. Each pin can have up to four possible functions: 20 | 21 | - **digitalWrite**: Sets the pin to HIGH or LOW, which either connects it to 3.3V (the maximum voltage of the system) or to GND (ground). Pin D7 is connected to an on-board LED; if you set pin D7 to HIGH, the LED will turn on, and if you set it to LOW, it will turn off. 22 | - **analogWrite**: Sets the pin to a value between 0 and 255, where 0 is the same as LOW and 255 is the same as HIGH. This is sort of like sending a voltage between 0 and 3.3V, but since this is a digital system, it uses a mechanism called Pulse Width Modulation, or PWM. You could use *analogWrite* to dim an LED, as an example. 23 | - **digitalRead**: This will read the digital value of a pin, which can be read as either HIGH or LOW. If you were to connect the pin to 3.3V, it would read HIGH; if you connect it to GND, it would read LOW. Anywhere in between, it'll probably read whichever one it's closer to, but it gets dicey in the middle. 24 | - **analogRead**: This will read the analog value of a pin, which is a value from 0 to 4095, where 0 is LOW (GND) and 4095 is HIGH (3.3V). All of the analog pins (A0 to A7) can handle this. *analogRead* is great for reading data from sensors. 25 | 26 | To change the function of the pin, simply tap and hold on the pin, and the function select menu will come back up. Any further questions? Come talk to us in the [forums!](https://community.sparkdevices.com/) 27 | 28 | The Tinker firmware 29 | --- 30 | 31 | The Tinker firmware is the default application program stored in the Spark Core upon its commissioning from the factory assembly line. You can always get back to it by putting the Core in the [factory reset mode](#buttons), or by re-flashing your Core with Tinker in the Spark app. 32 | 33 | To reflash Tinker from within the app: 34 | 35 | - **iOS Users**: Tap the list button at the top left. Then tap the arrow next to your desired Core and tap the "Re-flash Tinker" button in the pop out menu. 36 | - **Android Users**: With your desired Core selected, tap the options button in the upper right and tap the "Reflash Tinker" option in the drop down menu. 37 | 38 | The Tinker app is a great example of how to build a very powerful application with not all that much code. You can have a look at the latest release [here.](https://github.com/spark/core-firmware/blob/master/src/application.cpp) 39 | 40 | Using Tinker with Your Code 41 | --- 42 | 43 | I know what you're thinking: this is amazing, but I really want to use Tinker *while* my code is running so I can see what's happening! Now you can. 44 | 45 | Combine your code with this framework, flash it to your Core, and Tinker away. 46 | 47 | ```cpp 48 | int tinkerDigitalRead(String pin); 49 | int tinkerDigitalWrite(String command); 50 | int tinkerAnalogRead(String pin); 51 | int tinkerAnalogWrite(String command); 52 | 53 | //PUT YOUR VARIABLES HERE 54 | 55 | void setup() 56 | { 57 | Spark.function("digitalread", tinkerDigitalRead); 58 | Spark.function("digitalwrite", tinkerDigitalWrite); 59 | Spark.function("analogread", tinkerAnalogRead); 60 | Spark.function("analogwrite", tinkerAnalogWrite); 61 | 62 | //PUT YOUR SETUP CODE HERE 63 | 64 | 65 | } 66 | 67 | void loop() 68 | { 69 | //PUT YOUR LOOP CODE HERE 70 | 71 | 72 | } 73 | 74 | int tinkerDigitalRead(String pin) { 75 | int pinNumber = pin.charAt(1) - '0'; 76 | if (pinNumber< 0 || pinNumber >7) return -1; 77 | if(pin.startsWith("D")) { 78 | pinMode(pinNumber, INPUT_PULLDOWN); 79 | return digitalRead(pinNumber);} 80 | else if (pin.startsWith("A")){ 81 | pinMode(pinNumber+10, INPUT_PULLDOWN); 82 | return digitalRead(pinNumber+10);} 83 | return -2;} 84 | 85 | int tinkerDigitalWrite(String command){ 86 | bool value = 0; 87 | int pinNumber = command.charAt(1) - '0'; 88 | if (pinNumber< 0 || pinNumber >7) return -1; 89 | if(command.substring(3,7) == "HIGH") value = 1; 90 | else if(command.substring(3,6) == "LOW") value = 0; 91 | else return -2; 92 | if(command.startsWith("D")){ 93 | pinMode(pinNumber, OUTPUT); 94 | digitalWrite(pinNumber, value); 95 | return 1;} 96 | else if(command.startsWith("A")){ 97 | pinMode(pinNumber+10, OUTPUT); 98 | digitalWrite(pinNumber+10, value); 99 | return 1;} 100 | else return -3;} 101 | 102 | int tinkerAnalogRead(String pin){ 103 | int pinNumber = pin.charAt(1) - '0'; 104 | if (pinNumber< 0 || pinNumber >7) return -1; 105 | if(pin.startsWith("D")){ 106 | pinMode(pinNumber, INPUT); 107 | return analogRead(pinNumber);} 108 | else if (pin.startsWith("A")){ 109 | pinMode(pinNumber+10, INPUT); 110 | return analogRead(pinNumber+10);} 111 | return -2;} 112 | 113 | int tinkerAnalogWrite(String command){ 114 | int pinNumber = command.charAt(1) - '0'; 115 | if (pinNumber< 0 || pinNumber >7) return -1; 116 | String value = command.substring(3); 117 | if(command.startsWith("D")){ 118 | pinMode(pinNumber, OUTPUT); 119 | analogWrite(pinNumber, value.toInt()); 120 | return 1;} 121 | else if(command.startsWith("A")){ 122 | pinMode(pinNumber+10, OUTPUT); 123 | analogWrite(pinNumber+10, value.toInt()); 124 | return 1;} 125 | else return -2;} 126 | ``` 127 | 128 | The Tinker API 129 | --- 130 | 131 | When the Tinker firmware is installed on your Spark Core, it will respond to certain API requests from your mobile app, which mirror the four basic GPIO functions (digitalWrite, analogWrite, digitalRead, analogRead). These API requests can also be made from another application, so you can build your own web or mobile app around the Tinker firmware. 132 | 133 | ### digitalWrite 134 | 135 | Sets the pin to HIGH or LOW, which either connects it to 3.3V (the maximum voltage of the system) or to GND (ground). Pin D7 is connected to an on-board LED; if you set pin D7 to HIGH, the LED will turn on, and if you set it to LOW, it will turn off. 136 | 137 | POST /v1/devices/{DEVICE_ID}/digitalwrite 138 | 139 | # EXAMPLE REQUEST IN TERMINAL 140 | # Core ID is 0123456789abcdef 141 | # Your access token is 123412341234 142 | curl https://api.spark.io/v1/devices/0123456789abcdef/digitalwrite \ 143 | -d access_token=123412341234 -d params=D0,HIGH 144 | 145 | The parameters must be the pin (A0 to A7, D0 to D7), followed by either HIGH or LOW, separated by a comma. The return value will be 1 if the write succeeds, and -1 if it fails. 146 | 147 | 148 | 149 | ### analogWrite 150 | 151 | Sets the pin to a value between 0 and 255, where 0 is the same as LOW and 255 is the same as HIGH. This is sort of like sending a voltage between 0 and 3.3V, but since this is a digital system, it uses a mechanism called Pulse Width Modulation, or PWM. You could use *analogWrite* to dim an LED, as an example. 152 | 153 | POST /v1/devices/{DEVICE_ID}/analogwrite 154 | 155 | # EXAMPLE REQUEST IN TERMINAL 156 | # Core ID is 0123456789abcdef 157 | # Your access token is 123412341234 158 | curl https://api.spark.io/v1/devices/0123456789abcdef/analogwrite \ 159 | -d access_token=123412341234 -d params=A0,215 160 | 161 | The parameters must be the pin (A0 to A7, D0 to D7), followed by an integer value from 0 to 255, separated by a comma. The return value will be 1 if the write succeeds, and -1 if it fails. 162 | 163 | 164 | 165 | 166 | ### digitalRead 167 | 168 | This will read the digital value of a pin, which can be read as either HIGH or LOW. If you were to connect the pin to 3.3V, it would read HIGH; if you connect it to GND, it would read LOW. Anywhere in between, it'll probably read whichever one it's closer to, but it gets dicey in the middle. 169 | 170 | POST /v1/devices/{DEVICE_ID}/digitalread 171 | 172 | # EXAMPLE REQUEST IN TERMINAL 173 | # Core ID is 0123456789abcdef 174 | # Your access token is 123412341234 175 | curl https://api.spark.io/v1/devices/0123456789abcdef/digitalread \ 176 | -d access_token=123412341234 -d params=D0 177 | 178 | 179 | The parameter must be the pin (A0 to A7, D0 to D7). The return value will be 1 if the pin is HIGH, 0 if the pin is LOW, and -1 if the read fails. 180 | 181 | 182 | 183 | ### analogRead 184 | 185 | This will read the analog value of a pin, which is a value from 0 to 4095, where 0 is LOW (GND) and 4095 is HIGH (3.3V). All of the analog pins (A0 to A7) can handle this. *analogRead* is great for reading data from sensors. 186 | 187 | POST /v1/devices/{DEVICE_ID}/analogread 188 | 189 | # EXAMPLE REQUEST IN TERMINAL 190 | # Core ID is 0123456789abcdef 191 | # Your access token is 123412341234 192 | curl https://api.spark.io/v1/devices/0123456789abcdef/analogread \ 193 | -d access_token=123412341234 -d params=A0 194 | 195 | The parameters must be the pin (A0 to A7, D0 to D7). The return value will be between 0 and 4095 if the read succeeds, and -1 if it fails. 196 | -------------------------------------------------------------------------------- /src/content/zh/connect.md: -------------------------------------------------------------------------------- 1 | 连接您的 Core 2 | === 3 | 4 | 5 | 6 | 连接 Spark Core 到 Wi-Fi 的最简单方法是使用为 iPhone 或 Android 手机应用程序. 但如果这行不通,或者您没有 iOS/ Android 手机,我们还有还有其它方法. 7 | 8 | 对于所有下面的方法, Spark Core 必须在“聆听”模式,闪烁蓝色 LED 能让您知道它已在此模式. 9 | 10 | 11 | 12 | Core 在默认情况下会进入“聆听”模式,所以如果您的 Core 是全新的,它应该直接进入聆听模式. 否则,请按MODE按钮3秒钟. seconds. 13 | 14 | ## Spark 手机应用程序的智能配置 15 | 16 | 17 | 18 | 一旦您从 App Store 或 Google Play 下载星火核心的应用程序下载,您应该注册一个 Spark 帐户. 之后,您会被要求使用一种称为智能配置过程来连接您的 Core. 如果您的核心有U.FL连接器, 您必须启动智能配置前连接一个外接天线. **注意:您的手机必须连接到您想要 Core 连接到的Wi-Fi网络** 该应用程序会自动填入 SSID 字段与您的手机连接到网络的名称. 输入您的Wi-Fi密码,并点击连接。 19 | 20 | 21 | 22 | 智能配置可能需要长达一分钟的时间,请耐心等待. 如果您的手机越接近您的 Spark Core,它将更快连接. 一旦 core 听到信号时,它会通过灯光的顺序如下: 23 | 24 | - **蓝色固体**: 收到WiFi凭证 25 | - **绿色闪烁**: 正连接到Wi-Fi网络 26 | - **青色闪烁**: 正连接到 Spark 云 27 | - **青色慢速闪烁**: 已连接到 Spark 云 28 | 29 | 30 | 31 | 一旦 Spark Core 已经连接,您的手机将“认领” core,并将它附加到您的帐户. 然后您可以为您的 core 取名字. 如果您不确定认领过程是否成功,您可以登录 [Spark Web IDE](https://www.spark.io/build) 并在页面的底部点击“core”的图标. 您的 core 是否被列出? 太棒了!这个世界是完美的! 32 | 33 | *注意: Core **必须** 已连接到互联网 (青色慢速闪烁) 才能让认领过程运作. 如果 Spark Core 已被别人领取,手机运用程序将无法连接. 如果您需要把 Spark Core 过户到另一个户口, 请发电子邮件到 [hello@spark.io](mailto:hello@spark.io).* 34 | 35 | 36 | 37 | 如果您要连接多个 core,您会经历为每个核心命名的过程. 您会透过LED彩虹信号知道是哪一个. 38 | 39 | 40 | 41 | 一旦您已经完成了core的命名,您可以用 Tinker 控制它们! 尝试用 *digitalWrite* 在D7把用户LED打亮. 42 | 43 | ## 德州仪器(TI) 手机应用程序智能配置 44 | 45 | Texas Instruments(德州仪器) CC3000手机应用程序的智能配置过程与以上过程类似, 但您不需要用Spark帐户. TI 也提供 Java applet,可以从 Mac,Windows 或 Linux 电脑使用. 46 | 47 | 按照德州仪器(TI)的网站上的说明: 48 | 49 | [CC3000 Smart Config @ Texas Instruments](http://processors.wiki.ti.com/index.php/CC3000_Smart_Config) 50 | 51 | 唯一的不同的是,您需要通过可选的AES密钥并输入`sparkdevices2013`. 52 | 53 | *注意: 德州仪器(TI) 的手机应用程序不在 Google Play 上; 您必须从它们的网站下载它apk,自己安装在手机上.* 54 | 55 | ## 通过 USB 连接 56 | 57 | 您也可以通过 USB 串行通信连接 Spark Core 接到您的Wi-Fi网络. *注意: 这只有当 Spark Core 在聆听模式才能使用 (i.e. LED 在蓝色闪烁)*. 58 | 59 | 首先,您需要下载一个串行终端应用程序. 60 | 61 | __Windows__ 用户, 我们推荐 [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/). 62 | 您还需要安装 Windows 驱动程序: 63 | 64 | [Spark Core Windows 驱动程序 >](https://s3.amazonaws.com/spark-website/Spark.zip) 65 | 66 | [CoolTerm](http://freeware.the-meiers.org/) 提供一个很好的图形用户界面(GUI). 67 | ![CoolTerm 设置]({{assets}}/images/coolterm-settings.png) 68 | ![CoolTerm 安装]({{assets}}/images/coolterm-setup.png) 69 | 70 | __Mac__ 用户, 请使用 CoolTerm 或 screen work. 71 | 72 | __Linux__ 命令行用法, [GNU Screen](https://www.gnu.org/software/screen/) 很棒. 73 | (在OS X上,在命令行调用可能看起来像 `screen /dev/cu.usbmodem1411 9600`. 74 | 在Ubuntu上,它看起来像 `screen /dev/ttyACM0 9600`. 设备位置可能会有所不同,如果你不能马上找到它,请看 `/dev`目录.) 75 | 76 | __操作方法__ 77 | 78 | 将您的 Spark Core 通过 USB 连接到您的电脑. 当 Spark Core 是在聆听模式,通过 USB 打开一个串行端口,标准设置应该是: 79 | 80 | - baudrate(波特率): 9600 81 | - data bit(数据位): 8 82 | - parity(奇偶校验位): none 83 | - Stop Bits(停止数据位): 1 84 | 85 | 一旦您打开了一个串行连接,您有两个命令能透过键盘打**W**或**i** 使用. 它们的功能是: 86 | 87 | - **w**: 设置您的无线网络的SSID和密码 88 | - **i**: (“i”作为标识)读出 Spark Core 标识号 89 | 90 | **注意:**如果您通过USB第一次连接您的内核,你还需要亲自*认领*您的核心将它与您的帐户进行连接. 请参阅下面的章节 [认领您的 Core](/#/connect/claiming-your-core) 了解更多的细节. 91 | 92 | ## 即将推出:自编 SSID 和密码 93 | 94 | 目前还没有一种机制来自编您的 SSID 和密码到 Spark Core 里.我们正在努力! 95 | 96 | 认领您的 Core 97 | === 98 | 99 | 一旦您的 Spark Core 连接, 它需要被认领并与您的帐户相关联。.这就是让您控制您的 Spark Core 的方式 ,并保持其它人 无法这样做. 100 | 101 | 如果使用手机应用程序来设置您的 Spark Core, 它应该会自动认领. 但是,如果您通过USB连接您的 Core, 或者认领过程不成功,您可以亲自认领. 102 | 103 | 通过 USB 手动认取 core 最简单的方法是使用[Spark 命令行界面](https://github.com/spark/spark-cli). 一旦您安装了这个,您可以简单的输入'setup'的设置,并按照说明进行操作. 104 | 105 | 另外,如果您在安装命令行工具时遇到问题,您可以通过串行得到 core 的 标识号. 106 | 107 | 您可以通过打开串行与 core 连接,按下**i**关键做到这一点 (请但以上的‘通过 USB 连接’). 它应该告诉您一个类似的数字: 108 | 109 | # core 标识号 例子 110 | 55ff68064989495329092587 111 | 112 | --- 113 | 114 | 然后打开 [Spark Build](https://www.spark.io/build)并点击“core”图标. 点击上面写着' 添加一个 core“的该按钮, 并在文本框中输入您的 core 标识号. 115 | 116 | 117 | 118 | 119 | 120 | 附录 121 | === 122 | 123 | ## DFU 模式 (设备固件升级) 124 | 125 | 一如果您想通过 USB 把自定固件下载到 core, 您将需要使用此模式. 这个模式触发板上的 bootloader, 通过 DFU 下载二进制固件文件. 126 | 127 | 程序: 128 | 129 | 按住两个按键,然后松开 RST 键,同时还按住 MODE 按钮.一旦 LED 开始闪烁黄色,松开 MODE 按钮. Core 现在在 DFU 模式. 130 | 131 | 132 | 133 | 134 | ## 恢复出厂设置 135 | 136 | 出厂重置恢复的核心固件默认的 tinker 应用程序,并清除所有的 WiFi 凭证. 137 | 138 | 程序: 139 | 140 | 该程序和以上(DFU模式)所描述的相同. 但在这情况下您应该继续按住 MODE 键直到您看到 LED 从黄色闪烁变化到闪烁白色, 然后松开按钮. core 重新开始后,恢复出厂设置就完成了 141 | 142 | **注意:**这里的视频是从上面(DFU模式)的视频延续的. 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/content/zh/troubleshooting.md: -------------------------------------------------------------------------------- 1 | 无法连接 2 | === 3 | 4 | 您的 Spark Core 可能无法连接到您的网络有很多原因. 市面上有许多类型的Wi-Fi网络,而 Spark core 和 CC3000 不连接到所有的. 我们认为这是我们的一个重要目标. 以最轻松的方式, 尽可能连接到越多网络越好. 您的反馈意见是非常有价值的,这样我们就可以做得更好. 5 | 6 | Spark Core 与传统家庭网络的效果最佳:设用 WPA/WPA2 或 WEP 安全模式(或安全)的简单网络, 和只有一台从有信誉的公司的路由器(苹果,美国网件,Linksys的,D-Link的,等等)加上没有任何花哨的设置. 您的网络越比正常的不同,遇到的问题有可能更多. 7 | 8 | 有已知的问题与网络的种类如下: 9 | 10 | - **802.11n-only 网络**. Spark Core 是 802.11b/g. 大多的 802.11n 网络向后兼容与 802.11b/g, 但如果您的不是, Spark Core 将无法连接. 11 | - **网络设有 ["强制网络门户"](http://en.wikipedia.org/wiki/Captive_portal) 安全模式**. 强制网络门户,就像在星巴克,是个小网站. 会请您登录到网络或签署协议. Spark Core 无法浏览这些门户. 12 | - **企业网络**. 我们连接 Spark Core 到企业网络有不同的结果. 虽然我们还没有非常了解是什么造成这个问题, 但是我们正在努力改善. 13 | - **复杂网络**. 网络具有多个路由器,非标准防火墙和非标准设置. 14 | - **WEP安全模式的网路**. 如果与手机应用程序的连接效果很好,WEP 的安全网络应该没问题. 但是,您目前无法通过 USB 连接到 WEP 保护的网络. 我们现在正在实施这个修复程序,应该可以在接下来的几个星期看到. 15 | - **渠道11以上**.这是在一个国际特定的问题; 如果您是在美国以外,您的 Wi-Fi 路由器可能会运行在渠道 12,13,或 14, 其中CC3000不支持. 请使用编号为 11 或更低的渠道。 16 | 17 | 所以,让我们开始深入了解. 如果您的 Spark Core 无法连接到 Wi-Fi 网络,我们推荐遵循以下步骤: 18 | 19 | ## 步骤 0: 检查基本 20 | 21 | 首先要检查的一些常简单的问题: 22 | 23 | - 请检查您的Wi-Fi凭据(SSID和密码),以确保您正确键入了它们. 24 | - 请确保您在您的 Wi-Fi 网络的范围. 如果您的手机或电脑在同一位置连接不良,请尝试移动到更靠近您的 Wi-Fi 接入点. 25 | - 如果您使用的是 U.FL coere, 确保您有附加的天线. 并且,它是牢固连接的. 26 | - 请确保您的 core 有足够的电力来传输 Wi-Fi的信号(300毫安). 尝试使用不同的电源,或拔掉借鉴很多电的组成部分. 27 | 28 | ## 步骤 1: 通过 USB 安装您的 core 29 | 30 | 在某些网络中,智能配置不起作用,但 core 还是可以连接到网络. 我们已经实现了一个备份机制,这样您就可以通过 USB 安装您的 core. 有关说明,请参阅上面. 不要忘了,你需要亲自*认领*您的核心,如果您还没有! 31 | 32 | ## 步骤 2: 尝试用另一个网络 33 | 34 | 您的 Spark Core 可能无法连接到您的网络有很多原因; 有些是由于 Spare Core, 有些是由于您的移动设备发送的 Wi-Fi 认证,有些可能是由于网络. 如果您的 core 没有连接,请尝试另一个 Wi-Fi 网络.这将迅速帮助您找出问题. 35 | 36 | ## 步骤 3: 重新启动和删除记忆 37 | 38 | 39 | 40 | 有很多时候,电子产品关闭它们,然后将它们重新打开后,就开始表现正常. 尝试: 41 | 42 | - 关闭您的移动应用程序,并重新打开它 43 | - 拔开 Spark Core USB 然后把它插回 44 | - 按住 MODE 按钮 10 秒钟清除 Spark Core 内存的 Wi-Fi 网络. 3秒钟后,指示灯应开始闪烁蓝色; 10秒后,它应该做一个快速的蓝色闪烁. 这意味着记忆已被清除. 45 | - 恢复 Spark Core 的固件到出厂默认值状态. [此视频](https://community.spark.io/t/how-to-do-a-factory-reset/2579) 作说明. 46 | 47 | ## 步骤 4: 请检查您的路由器设置 48 | 49 | 有一百万个方式路由器的设置可能会导致问题,但这里有几件事情要注意的事项: 50 | 51 | - **使用DHCP**. 尽管 Spark Core 可以处理静态 IP 地址, 它不是默认配置. 所以您必须要深入到源代码. 52 | - **关闭访问控制和防火墙**. 不是永久的,而是暂时的,看它是否解决问题. 如果是这样,您可以尝试调整您的设置,以适 core,而不是降低您的安全模式. 您可能需要对您的路由器唯一的变化是开辟出 [COAP] 默认的 5683 端口, [CoAP](http://en.wikipedia.org/wiki/Constrained_Application_Protocol) 端口是用于连接到 Spark 云. 如果您的核心闪烁青色和偶尔闪烁红色,路由器的问题很可能是罪魁祸首. 53 | 54 | ## 步骤 5: 搜索论坛 55 | 56 | 这有可能是其他人都遇到过的同样的问题. 检查和向他人学习的最好方法是搜索论坛; 搜索您的特定症状或为您的 Wi-Fi 路由器的品牌和型号来找到相关的帖子. 57 | 58 | [请到论坛 >](https://community.sparkdevices.com) 59 | 60 | ## 步骤 6: 发布一份报告 61 | 62 | 我们很想听到您的问题,不管你是否能够解决这些问题,让我们可以学习改善我们的平台. 如果您还没有能够解决您的问题, 希望我们或社区将能够帮助. 63 | 64 | 请张贴回应相同的话题,或者,如果您的连接问题和其他不同,打开一个新的论坛帖子. 当你打开一个新的论坛帖子,请包括: 65 | 66 | - 路由器的品牌和型号 67 | - 网络安全(无抵押,WEP,WPA2等) 68 | - 环境(家庭,小型办公室,企业,公共网络等) 69 | - 网络拓扑(多个路由器和/或范围扩展器,连接到网络的设备的估计数目) 70 | - 互联网服务提供商 71 | - 任何可能偏离正常的网络设置 72 | 73 | 按颜色疑难解答 74 | === 75 | 76 | Spark Core 有一个 RGB LED 定位在的前部,显示 core 的连接状态.此指示灯可以帮助您调试 core 和解决可能遇到的任何问题. 77 | 78 | ## 蓝色闪烁 79 | 80 | 81 | 82 | - *Core 在做什么?* 我的核心是闪烁的蓝色? 83 | - *问题是什么?* 您的 core 不具备Wi-Fi认证,无法加入您的本地网络 84 | - *我如何修复它?* 85 | 86 | 现在,您的 core 没有它需要连接到您的本地 Wi-Fi 网络的信息. 如果您还没有,请尝试使用 Spark Core [iPhone](https://itunes.apple.com/us/app/spark-core/id760157884) 或 [Android](https://play.google.com/store/apps/details?id=io.spark.core.android) 应用程序发送您的网络凭据到您的 core. 详细的说明可以看 [这里](http://docs.spark.io/#/connect/connecting-your-core-smart-config-with-the-ti-app). 87 | 88 | 89 | 如果还是不行,请尝试以下步骤: 90 | 91 | 92 | 1. 如果您的网络路由器支持 802.11n 标准,确保它也支持传统的网络协议,并且它被配置成这种模式(core 支持 802.11 的 A/C 网) 93 | 2. 如果你有一个 U.FL 连接器的 core,确保天线已连接. 94 | 3. 尝试 [重新启动 core 和清除它的内存](/#/connect/troubleshooting-step-3-reboot-and-clear-memory). 95 | 4. 尝试通过 USB 配置 core. 步骤可以在这里找到 [here](/#/connect/connecting-your-core-connect-over-usb). 96 | 5. 如果一切都失败,请 [联系 Spark Team](邮寄地址:hello@sparkdevices.com)并且向我们提供您的智能手机的品牌和型号. 97 | 98 | --- 99 | 100 | 101 | ## 绿色闪烁 102 | 103 | - *Core 在做什么?* Core 正在 [绿色闪烁](https://mtc.cdn.vine.co/r/videos/DB9E0E87311015399731217969152_1d6c83d12a3.4.3.2795910212236322177_4RBA9frM0a4pwIG_RbZgo.ZOBEbBr_CpxzoOsBNuExDz6TFldcjJSYHVh203e6F4.mp4?versionId=orM0m0DvLYdciAwsb6DYHhqb974AHMj_), 但不会进展到闪烁青色. 104 | - *问题是什么?* 您的 core 已收到 Wi-Fi 的认证(SSID 和密码),但仍无法连接到Wi-Fi网络. 105 | - *我如何修复它?* 106 | 107 | 请完成以下步骤: 108 | 109 | 1. [检查基本](/#/connect/troubleshooting-step-0-check-the-basics). 110 | 2. 尝试新的点源适配器. 您所用的电源应能够提 core,为 500mA 的电流. 我们建议使用通常用于手机充电的 5V/1A 电源适配器. 111 | 3. 如果您的网络有一个登陆页面,核心将无法进行连接;尝试将其配置到不同的网络. 112 | 4. 尝试 [重新启动 core 和清除它的内存](/#/connect/troubleshooting-step-3-reboot-and-clear-memory). 113 | 5. 尝试恢复出厂设置.按住两个按键,然后只松开RST键. LED应开始闪烁黄色. 继续按住 MODE 键直到您看到闪烁的黄色变化成闪烁的白色, 然后松开按钮. Core 恢复出厂设置完成后应该开始 [闪烁蓝色](https://v.cdn.vine.co/r/videos/E465A8959B1015390893882101760_178fcfd2b3c.4.3.11510817618992331600_MIW9HE1mtZ9H_SpBlKdK1lv2UfmniExCFQHrgJ7iqiFDUiDb0E31bR7GwvB_7wz0.mp4?versionId=eS01KUZ6NaUZgEipSDeVi0rxZENByp1N) 114 | 6. 尝试通过 USB 运行,重新补丁程序员,更新 CC3000 的固件. 您可以在 [这里](https://community.sparkdevices.com/t/failed-connecting-to-wifi/648/53) 找到详细的说明. 115 | 7. 如果以上都不成功,请 [联系 Spark Team](邮寄地址:hello@sparkdevices.com),并为我们提供路由器的品牌和型号. 116 | 117 | --- 118 | 119 | ## 黄色闪烁 120 | 121 | - *Core 在做什么?* 当我开启电源,或当我按 RST 按, core 便开始闪烁黄色. 122 | - *问题是什么?* 您的 core 缺少重要的固件. 123 | - *我如何修复它?* 124 | 125 | 请完成以下步骤: 126 | 127 | 1. 尝试打 RST 键,以确保您没不小心设定您的核心进入 DFU 模式. 128 | 2. 尝试恢复出厂设置.按住两个按键,然后只松开RST键. LED应开始闪烁黄色. 继续按住 MODE 键直到您看到闪烁的黄色变化成闪烁的白色, 然后松开按钮. Core 后恢复出厂设置完成后应该开始 [闪烁蓝色](https://v.cdn.vine.co/r/videos/E465A8959B1015390893882101760_178fcfd2b3c.4.3.11510817618992331600_MIW9HE1mtZ9H_SpBlKdK1lv2UfmniExCFQHrgJ7iqiFDUiDb0E31bR7GwvB_7wz0.mp4?versionId=eS01KUZ6NaUZgEipSDeVi0rxZENByp1N) 129 | 3. 如果恢复出厂设置不成功,那么我们就通过 DFU 更新固件. 您可以按照以下的步骤做: 130 | 131 | Mac 使用自制软件, Windows 需要到 http://dfu-util.gnumonks.org 下载,或者您也可以从源代码在Linux上构建,安装 DFU-util: 132 | 133 | opkg install libusb-1.0-dev 134 | wget http://dfu-util.gnumonks.org/releases/dfu-util-0.7.tar.gz 135 | tar xvf dfu-util-0.7.tar.gz 136 | cd dfu-util-0.7 137 | ./configure 138 | make 139 | sudo make install 140 | 141 | --- 142 | 143 | 如果您安装了这些,您应该通过 USB 与您的 core 连接: 144 | 145 | sudo dfu-util -l 146 | 147 | --- 148 | 149 | 这应该给您一个列表. 列表中应有 [1d50:607F],如果是这样的话, 那么我们就可以安装缺少的固件(可以在这里找到:https://s3.amazonaws.com/spark-website/factory_firmware.bin) 150 | 151 | dfu-util -d 1d50:607f -a 1 -s 0x00020000 -D factory_firmware.bin 152 | dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D factory_firmware.bin 153 | 154 | 你可以重新启动您的 core. 如果一切顺利,它应该开始 [慢速闪烁蓝色](https://v.cdn.vine.co/r/videos/E465A8959B1015390893882101760_178fcfd2b3c.4.3.11510817618992331600_MIW9HE1mtZ9H_SpBlKdK1lv2UfmniExCFQHrgJ7iqiFDUiDb0E31bR7GwvB_7wz0.mp4?versionId=eS01KUZ6NaUZgEipSDeVi0rxZENByp1N), 或开始 [绿色闪烁](https://mtc.cdn.vine.co/r/videos/DB9E0E87311015399731217969152_1d6c83d12a3.4.3.2795910212236322177_4RBA9frM0a4pwIG_RbZgo.ZOBEbBr_CpxzoOsBNuExDz6TFldcjJSYHVh203e6F4.mp4?versionId=orM0m0DvLYdciAwsb6DYHhqb974AHMj_) 155 | 156 | 如果以上都不成功,请[联系 Spark Team](邮寄地址:hello@sparkdevices.com). 157 | 158 | --- 159 | 160 | ## 橙色闪烁(红色/黄色) 161 | 162 | - *Core 在做什么?* 我的 core 接到 Wi-Fi 后,开始闪烁黄色/红色/橙色 163 | - *问题是什么?* 与 Spark 云握手期间发生错误解密 164 | - *我如何修复它?* 165 | 166 | 请完成以下步骤: 167 | 168 | 1.全套解决这个问题的指示可以在以下的星火社区论坛位置找到. 如果都不成功,请[联系 Spark Team](邮寄地址:hello@sparkdevices.com) 169 | 170 | [更换你的 Spark 云凭据 >](https://community.sparkdevices.com/t/troubleshooting-my-core-is-flashing-yellow-red-lights-after-it-connects-to-wifi/627) 171 | 172 | --- 173 | 174 | ## 绿色闪烁接着红色 175 | 176 | - *Core 在做什么?* 我的核心开始闪烁绿色并连接到我的网络,然后 LED 变成红色. 177 | - *问题是什么?* 您的 core 正面临着一个网络问题,无法连接到 Spark 云. 178 | - *我如何修复它?* 179 | 180 | 有两种潜在的失效模式存在 - 你的家庭网络没有一个可用的互联网连接,或者我们的服务器出现问题. 181 | 182 | 1. 请尝试重新启动路由器来解决任何 Wi-Fi 网络短暂的网络问题. 183 | 2. 尝试使用电脑到一个网站 [谷歌](http://www.google.com/) 以验证您的Wi-Fi网络连接到互联网,并能服务于 web 页面. 184 | 3. 查看 www.spark.io/status,看看是否有一个已知的 Spark 云问题 185 | 4. 如果您还在看这个问题, 请[联系 Spark Team](邮寄地址:hello@sparkdevices.com). 186 | 187 | --- 188 | 189 | ## 主要 LED 没亮起,小蓝色 LED 暗淡 190 | 191 | - *Core 在做什么?* Spark Core 的主要 LED 没亮起,但右上角的小蓝色 LED 发光暗淡. 192 | - *问题是什么?* 您的 core 缺失的固件. 193 | - *我如何修复它?* 194 | 195 | 1. 尝试恢复出厂设置.按住两个按键,然后只松开RST键. LED应开始闪烁黄色. 继续按住 MODE 键直到您看到闪烁的黄色变化成闪烁的白色, 然后松开按钮. Core 恢复出厂设置完成后应该开始. 196 | 2. 如果您在恢复出厂设置后没有看到闪灯,那么您的 core 可能暂时不起作用. 如果你有一个 JTAG shield, [联系 Spark Team ](邮寄地址:hello@spark.io)这样我们就可以帮您完成重新安装内核固件. 如果你没有一个 JTAG shield, 请 [联系 Spark Team ](邮寄地址:hello@spark.io) 让我们知道,我们会帮助您采取下一步措施. 197 | 198 | ## LED 灯关闭,反应迟钝 199 | 200 | - *Core 在做什么?* 当我通过 USB 供电, core 没有显示任何 LED 的活动. 201 | - *问题是什么?* 你的核心没有接通电源. 202 | - *我如何修复它?* 203 | 204 | 请完成以下步骤: 205 | 206 | 1. 试着使用不同的 USB 电缆和电源为 core 供电(例如,您的电脑上不同的 USB 端口) 207 | 2. 如果使用不同的USB电缆和电源不解决这个问题,你的 core 硬件可能出现问题, 请 [联系 Spark Team ](邮寄地址:hello@spark.io) 为进一步调试. 208 | 209 | 210 | 211 | Known Issues 212 | === 213 | 214 | ## Flashing Cyan 215 | * Status: **Solution in progress, available in 1-2 weeks** 216 | * Forum Thread: https://community.spark.io/t/bug-bounty-kill-the-cyan-flash-of-death/1322 217 | 218 | #### Description 219 | 220 | With certain WiFi networks, the Spark Core will sometimes enter a state where the status LED will flash cyan. Flashing cyan means that the Spark Core can no longer communicate with the Spark Cloud server. If this happens, the Spark Core is programmed to try to reconnect. When the Core reconnects, the status LED will go back to 'Breathing Cyan'. 221 | 222 | The Spark Core is equipped with a Texas Instruments (TI) CC3000 WiFi module to facilitate wireless networking. The CC3000 module has it's own closed-source firmware that was created by TI. Unfortunately, it was discovered that the firmware on the CC3000 module itself has an issue that can cause the module to stop responding. In this case, the Spark Core entered a permanent state of flashing cyan referred to as the 'Cyan Flash of Death' or CFOD. A reset was required to reconnect the Spark Core. 223 | 224 | The good news is that the firmware on the CC3000 module can be updated and the Spark team has been working with TI in order to resolve the issue. Also, because of the great work by many community members and the Spark team, the Spark Core firmware has been modified to work around the issues with the CC3000. When the CC3000 fails, the Spark Core firmware will attempt to reset the CC3000 and reconnect to the Spark Cloud. 225 | 226 | So far TI has supplied a couple of firmware patches to the Spark Team to test, but at this time, the issue doesn't seem to have been fully resolved. TI has been very helpful during this process and we're hopeful to have a fix soon. When the fix is ready and fully tested, we will provide instructions on how to update the CC3000 firmware. 227 | 228 | ## Spark.publish() breaks inside of Spark.function() 229 | * Status: **Acknowledged** 230 | * Forum Thread: https://community.spark.io/t/spark-publish-crashing-core/3463 231 | 232 | #### Description 233 | 234 | If `Spark.publish()` is called within a function declared in `Spark.function()`, the Core may become unresponsive for a short period of time and return a 408 timed out error in the cloud API call. 235 | 236 | A fix can be applied in the user code that will work around this issue. A simple explanation can be found in [post #10 of the forum thread](https://community.spark.io/t/spark-publish-crashing-core/3463/10). 237 | 238 | Recently Resolved Issues 239 | === 240 | 241 | ## Flashing Blue 242 | * Status: **Resolved as of v0.2.0** 243 | * Github Issue: https://github.com/spark/core-firmware/issues/144 244 | * Forum Thread: https://community.spark.io/t/status-led-flashing-blue/2915 245 | 246 | #### Description 247 | 248 | In some cases after attempting to connect to a Wi-Fi network and failing repeatedly, the Core will step back into listening mode, and will stop attempting to connect to the internet. 249 | 250 | This issue has been resolved, and the fix was pushed with firmware v0.2.0 on March 25. 251 | 252 | ## Inaccurate analog readings 253 | * Status: **Resolved as of v0.2.0** 254 | * Forum Thread: https://community.spark.io/t/odd-analog-readings/906 255 | * Forum Thread: https://community.spark.io/t/odd-analog-readings-part-2/2718 256 | 257 | #### Description 258 | 259 | Timing issues were causing analog readings to return incorrectly; this has now been fixed with [this commit](https://github.com/spark/core-firmware/commit/b7ce24a4fb2dfe4f90e597e3a0f568f9ae098cfe). 260 | 261 | This issue has been resolved, and the fix was pushed with firmware v0.2.0 on March 25. 262 | 263 | ## Serial1 UART missing data 264 | * Status: **Resolved** 265 | 266 | #### Description 267 | 268 | Previously, Serial UART was polling, and data could be dropped if the user code did not check frequently enough. Serial UART is now interrupt driven, so this is no longer an issue. 269 | 270 | ## Long delays break connectivity 271 | * Status: **Resolved** 272 | * Forum Thread: https://community.spark.io/t/known-issue-long-delays-or-blocking-code-kills-the-connection-to-the-cloud/950 273 | 274 | #### Description 275 | 276 | Long delays can keep messages from being sent to the Cloud, which can cause the connection with the Cloud to abruptly die. 277 | 278 | We recently released an update to process Cloud messages during long delays, making this issue significantly less of a problem. It is still possible to block the connection to the Cloud with a long series of very short delays, but longer delays will no longer cause issues. 279 | 280 | ## Can't init. peripherals in constructors 281 | * Status: **Resolved** 282 | * Forum Thread: https://community.spark.io/t/serial1-begin-in-class-constructor-hangs-core/3133 283 | 284 | #### Description 285 | 286 | Constructors are now called after the Core is initialized. 287 | -------------------------------------------------------------------------------- /src/layouts/docs.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Spark Docs | {{title}} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
    36 |
    37 |
    38 | 39 | 40 | 41 |
    42 |
    43 | 44 | 45 | Edit this page 46 |
    47 |
    48 | 49 |
    50 | 63 |
    64 | {{#markdown}} 65 | {{> body}} 66 | {{/markdown}} 67 |
    68 |
    69 |
    70 | 71 | 72 | 73 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/stylesheets/basics.less: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Fonts 3 | */ 4 | @import url("http://fonts.googleapis.com/css?family=Montserrat:700|Open+Sans:700,400,300"); 5 | 6 | @font-face { 7 | font-family: "Inconsolata"; 8 | src: url("../fonts/Inconsolata.otf") format("opentype"); 9 | } 10 | /* ---------------------------------------------------------------------------- 11 | * Base 12 | */ 13 | html, 14 | body, 15 | div, 16 | span, 17 | applet, 18 | object, 19 | iframe, 20 | h1, 21 | h2, 22 | h3, 23 | h4, 24 | h5, 25 | h6, 26 | p, 27 | blockquote, 28 | pre, 29 | a, 30 | abbr, 31 | acronym, 32 | address, 33 | big, 34 | cite, 35 | code, 36 | del, 37 | dfn, 38 | em, 39 | img, 40 | ins, 41 | kbd, 42 | q, 43 | s, 44 | samp, 45 | small, 46 | strike, 47 | strong, 48 | sub, 49 | sup, 50 | tt, 51 | var, 52 | dl, 53 | dt, 54 | dd, 55 | ol, 56 | ul, 57 | li, 58 | fieldset, 59 | form, 60 | label, 61 | legend, 62 | table, 63 | caption, 64 | tbody, 65 | tfoot, 66 | thead, 67 | tr, 68 | th, 69 | td { 70 | margin: 0; 71 | padding: 0; 72 | border: 0; 73 | outline: 0; 74 | font-weight: inherit; 75 | font-style: inherit; 76 | font-family: inherit; 77 | font-size: 100%; 78 | vertical-align: baseline; 79 | } 80 | body { 81 | line-height: 1; 82 | color: #000; 83 | background: #fff; 84 | } 85 | ol, 86 | ul { 87 | list-style: none; 88 | } 89 | table { 90 | border-collapse: separate; 91 | border-spacing: 0; 92 | vertical-align: middle; 93 | } 94 | caption, 95 | th, 96 | td { 97 | text-align: left; 98 | font-weight: normal; 99 | vertical-align: middle; 100 | } 101 | a img { 102 | border: none; 103 | } 104 | html, 105 | body { 106 | height: 100%; 107 | } 108 | html { 109 | overflow-x: hidden; 110 | } 111 | body, 112 | td, 113 | textarea, 114 | input { 115 | font-family: Open Sans, sans-serif; 116 | line-height: 1.6; 117 | font-size: 14px; 118 | color: #505050; 119 | } 120 | pre code { 121 | color: #fff; 122 | } 123 | @media (max-width: 480px) { 124 | body, 125 | td, 126 | textarea, 127 | input { 128 | font-size: 14px; 129 | } 130 | } 131 | a { 132 | color: #2badad; 133 | text-decoration: none; 134 | } 135 | a:hover { 136 | color: #228a8a; 137 | } 138 | -------------------------------------------------------------------------------- /src/stylesheets/colors.less: -------------------------------------------------------------------------------- 1 | a, 2 | .menu a, 3 | .menu a:visited { 4 | color: #00adef; 5 | } 6 | 7 | a:hover, 8 | .menu a:hover { 9 | color: #006d9f; 10 | } 11 | 12 | .menu a.active:after { 13 | background: #00adef; 14 | } 15 | 16 | .button, .button:visited { 17 | background: #00adef; 18 | border:0; 19 | padding: 5px 25px 7px; 20 | } 21 | 22 | .button:hover { 23 | background: #007daf; 24 | } 25 | 26 | @spark-blue: #00adef; 27 | @monokai-gray: #272822; 28 | @transparent-monokai: rgba(39,40,34,0); 29 | -------------------------------------------------------------------------------- /src/stylesheets/core.less: -------------------------------------------------------------------------------- 1 | /************** 2 | * A CORE MADE OF CSS 3 | **************/ 4 | 5 | #button1 { 6 | position: relative; 7 | top:-80px; 8 | left: 120px; 9 | cursor: pointer; 10 | } 11 | 12 | @media (min-width: 1180px) { 13 | body:not(.no-literate) #core1 { 14 | margin-left: 40px; 15 | } 16 | } 17 | 18 | .core { 19 | width: 100px; 20 | height: 130px; 21 | background: rgba(0,0,0,0.2); 22 | position: relative; 23 | top: 15px; 24 | display: inline-block; 25 | } 26 | .core-butt { 27 | height: 0; 28 | width: 60px; 29 | content:""; 30 | position: absolute; 31 | border-top: 20px solid rgba(0,0,0,0.2); 32 | border-left: 20px solid transparent; 33 | border-right: 20px solid transparent; 34 | top: 130px; 35 | } 36 | 37 | .core.small { 38 | width: 60px; 39 | height: 80px; 40 | } 41 | 42 | .small .core-butt { 43 | width: 40px; 44 | border-top: 10px solid rgba(0,0,0,0.2); 45 | border-left: 10px solid transparent; 46 | border-right: 10px solid transparent; 47 | top: 80px; 48 | } 49 | 50 | .rgb { 51 | width: 0; 52 | height: 0; 53 | } 54 | 55 | .cyan { 56 | background: #00ffff; 57 | } 58 | 59 | .red { 60 | background: #ff0000; 61 | } 62 | 63 | .green { 64 | background: #00ff00; 65 | } 66 | 67 | .blue { 68 | background: #0000ff; 69 | } 70 | 71 | .magenta { 72 | background: #ff00ff; 73 | } 74 | 75 | .yellow { 76 | background: #ffff00; 77 | } 78 | 79 | .pattern { 80 | width: 20px; 81 | height: 20px; 82 | border-radius: 20px; 83 | content: ""; 84 | background: white; 85 | position: absolute; 86 | top: 20px; 87 | left: 40px; 88 | } 89 | 90 | .small .pattern { 91 | width: 15px; 92 | height: 15px; 93 | top: 15px; 94 | left: 22.5px; 95 | } 96 | 97 | .breathing { 98 | animation: change 4s infinite; 99 | -webkit-animation: change 4s infinite; 100 | -moz-animation: change 4s infinite; 101 | -o-animation: change 4s infinite; 102 | } 103 | 104 | .flashing { 105 | animation: change 0.4s infinite step-end; 106 | -webkit-animation: change 0.4s infinite step-end; 107 | -moz-animation: change 0.4s infinite step-end; 108 | -o-animation: change 0.4s infinite step-end; 109 | } 110 | 111 | .fast { 112 | animation-duration: 0.1s; 113 | -webkit-animation-duration: 0.1s; 114 | -moz-animation-duration: 0.1s; 115 | -o-animation-duration: 0.1s; 116 | } 117 | 118 | @keyframes change { 119 | from, to { background: rgba(0,0,0,0.1); } 120 | 50% { background: inherit; } 121 | } 122 | 123 | @-webkit-keyframes change { 124 | from, to { background: rgba(0,0,0,0.1); } 125 | 50% { background: inherit; } 126 | } 127 | 128 | @-moz-keyframes change { 129 | from, to { background: rgba(0,0,0,0.1); } 130 | 50% { background: inherit; } 131 | } 132 | 133 | @-o-keyframes change { 134 | from, to { background: rgba(0,0,0,0.1); } 135 | 50% { background: inherit; } 136 | } 137 | -------------------------------------------------------------------------------- /src/stylesheets/header.less: -------------------------------------------------------------------------------- 1 | #logo { 2 | height: 32px; 3 | display: block; 4 | padding: 10px; 5 | } 6 | 7 | a.icon { 8 | font-size: 32px; 9 | color: #9090aa; 10 | margin-right: 20px; 11 | margin-top: 10px; 12 | } 13 | 14 | a.icon:hover { 15 | color: #3a3a44; 16 | } 17 | 18 | .header { 19 | background: #f3f6fb; 20 | zoom: 1; 21 | height: 52px; 22 | border-bottom: solid 1px #dfe2e7; 23 | } 24 | .header .left { 25 | float: left; 26 | } 27 | .header .right { 28 | float: right; 29 | } 30 | 31 | .header a.button { 32 | vertical-align: top; 33 | margin-top: 10px; 34 | } 35 | 36 | /* 37 | @media (min-width: 480px) { 38 | .header h1 { 39 | float: left; 40 | } 41 | .header ul, 42 | .header li { 43 | display: block; 44 | float: left; 45 | } 46 | .header ul { 47 | margin-left: -15px; 48 | } 49 | .header h1 + ul { 50 | border-left: solid 1px #dfe2e7; 51 | margin-left: 15px; 52 | } 53 | .header li { 54 | border-left: solid 1px rgba(255,255,255,0.5); 55 | border-right: solid 1px #dfe2e7; 56 | } 57 | .header li:last-child { 58 | border-right: 0; 59 | } 60 | .header li a { 61 | padding: 0 15px; 62 | } 63 | } 64 | 65 | @media (min-width: 1180px) { 66 | .header ul { 67 | border-left: solid 1px #dfe2e7; 68 | margin-left: 15px; 69 | } 70 | } 71 | 72 | @media (max-width: 1180px) { 73 | .header ul { 74 | padding-top: 10px; 75 | clear: both; 76 | } 77 | } 78 | */ 79 | -------------------------------------------------------------------------------- /src/stylesheets/menu.less: -------------------------------------------------------------------------------- 1 | .menubar { 2 | -webkit-font-smoothing: antialiased; 3 | text-rendering: optimizeLegibility; 4 | } 5 | .menubar .section { 6 | padding: 30px 30px; 7 | -webkit-box-sizing: border-box; 8 | -moz-box-sizing: border-box; 9 | box-sizing: border-box; 10 | } 11 | .menubar .section + .section { 12 | border-top: solid 1px #dfe2e7; 13 | } 14 | .menubar .section.no-line { 15 | border-top: 0; 16 | padding-top: 0; 17 | } 18 | 19 | @media (max-width: 480px) { 20 | .menubar { 21 | padding: 20px; 22 | border-bottom: solid 1px #dfe2e7; 23 | } 24 | } 25 | @media (max-width: 768px) { 26 | .menubar { 27 | } 28 | } 29 | @media (min-width: 768px) { 30 | .content-root { 31 | padding-left: 230px; 32 | } 33 | .menubar { 34 | position: absolute; 35 | left: 0; 36 | top: 0; 37 | bottom: 0; 38 | width: 230px; 39 | border-right: solid 1px #dfe2e7; 40 | } 41 | .menubar.fixed { 42 | position: fixed; 43 | overflow-y: auto; 44 | } 45 | .menubar.fixed { 46 | -webkit-overflow-scrolling: touch; 47 | } 48 | .menubar.fixed::-webkit-scrollbar { 49 | width: 15px; 50 | height: 15px; 51 | } 52 | .menubar.fixed::-webkit-scrollbar-thumb { 53 | background: #ddd; 54 | -webkit-border-radius: 8px; 55 | border-radius: 8px; 56 | border: solid 4px #fff; 57 | } 58 | .menubar.fixed:hover::-webkit-scrollbar-thumb { 59 | background: #999; 60 | -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); 61 | box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2); 62 | } 63 | } 64 | 65 | .menubar { 66 | font-size: 12px; 67 | } 68 | 69 | .menu ul.level-1 > li + li { 70 | margin-top: 20px; 71 | } 72 | 73 | .menu a { 74 | -webkit-box-sizing: border-box; 75 | -moz-box-sizing: border-box; 76 | box-sizing: border-box; 77 | position: relative; 78 | display: block; 79 | padding-top: 1px; 80 | padding-bottom: 1px; 81 | margin-right: -30px; 82 | } 83 | 84 | .menu a, 85 | .menu a:visited { 86 | color: #2badad; 87 | } 88 | 89 | .menu a:hover { 90 | color: #228a8a; 91 | } 92 | 93 | .menu a.level-0, 94 | .menu a.level-0:visited { 95 | font-family: montserrat, sans-serif; 96 | text-transform: uppercase; 97 | font-size: 12px; 98 | font-weight: bold; 99 | color: #505050; 100 | padding-top: 5px; 101 | padding-bottom: 4px; 102 | } 103 | 104 | .menu a.level-0:hover { 105 | color: #333333; 106 | } 107 | 108 | .menu a.level-0.active { 109 | background: #eeeeee; 110 | margin-left: -30px; 111 | padding-left: 30px; 112 | } 113 | 114 | .menu a.level-1 { 115 | font-family: montserrat, sans-serif; 116 | text-transform: uppercase; 117 | font-size: 12px; 118 | font-weight: bold; 119 | } 120 | 121 | .menu li:first-child a.level-1 { 122 | color: #333333; 123 | } 124 | 125 | .menu a.level-1, 126 | .menu a.level-1:visited { 127 | color: #9090aa; 128 | } 129 | .menu a.level-1:hover { 130 | color: #565666; 131 | } 132 | .menu a.level-2 { 133 | font-weight: normal; 134 | font-size: 12px; 135 | } 136 | .menu a.level-3 { 137 | font-weight: normal; 138 | font-size: 12px; 139 | padding-left: 10px; 140 | } 141 | .menu a.active { 142 | font-weight: bold !important; 143 | } 144 | .menu #toc a.active, 145 | .menu #toc a.active:visited, 146 | .menu #toc a.active:hover { 147 | color: #505050 !important; 148 | } 149 | .menu #toc a.active:after { 150 | content: ''; 151 | display: block; 152 | -webkit-box-sizing: border-box; 153 | -moz-box-sizing: border-box; 154 | box-sizing: border-box; 155 | position: absolute; 156 | top: 10px; 157 | right: 30px; 158 | width: 9px; 159 | height: 3px; 160 | -webkit-border-radius: 2px; 161 | border-radius: 2px; 162 | background: #2badad; 163 | } 164 | -------------------------------------------------------------------------------- /src/stylesheets/prettify.less: -------------------------------------------------------------------------------- 1 | /* ======================== 2 | //#google-prettify-monokai-theme 3 | //#Version: 0.2 4 | //#Author: RaphaelDDL 5 | //#Github: https://github.com/RaphaelDDL/google-prettify-monokai-theme/ 6 | //#MIT LICENSE 7 | //#https://github.com/RaphaelDDL/compass-generic-config/blob/master/LICENSE 8 | //For use with Google Code Prettify, HTML Syntax only 9 | //======================== */ 10 | 11 | pre .str, code .str { color: #e6db5a; } /* string */ 12 | pre .kwd, code .kwd { color: #66d9ef; } /* keyword */ 13 | pre .com, code .com { color: #75715e; font-style: italic; } /* comment */ 14 | pre .typ, code .typ { color: #66d9ef; } /* type */ 15 | pre .lit, code .lit { color: #ae81ff; } /* literal */ 16 | pre .pun, code .pun { color: #fff; } /* punctuation */ 17 | pre .pln, code .pln { color: #fff; } /* plaintext */ 18 | pre .tag, code .tag { color: #f92672; } /* html/xml tag */ 19 | pre .atn, code .atn { color: #a6e22a; } /* html/xml attribute name */ 20 | pre .atv, code .atv { color: #e6db74; } /* html/xml attribute value */ 21 | pre .dec, code .dec { color: #ae81ff; } /* decimal */ 22 | 23 | pre.prettyprint, code.prettyprint { 24 | background-color: @monokai-gray; 25 | -moz-border-radius: 8px; 26 | -webkit-border-radius: 8px; 27 | -o-border-radius: 8px; 28 | -ms-border-radius: 8px; 29 | -khtml-border-radius: 8px; 30 | border-radius: 8px; 31 | } 32 | 33 | pre.prettyprint { 34 | width: 100%; 35 | margin: 1em auto; 36 | padding: 1em; 37 | white-space: pre-wrap; 38 | } 39 | 40 | pre.prettyprinted { 41 | box-shadow:inset 0 0 1px 2px #3c3d39, 0 0 15px rgba(0,0,0,0.5); 42 | border:1px solid #0b0c0a; 43 | } 44 | 45 | 46 | /* ------------------------ 47 | //Section: class 'linenums' for line numbering 48 | //------------------------ */ 49 | ol.linenums { 50 | margin-top: 0; 51 | margin-bottom: 0; 52 | color: #75715e; 53 | list-style: decimal inside !important; 54 | } /* IE indents via margin-left */ 55 | 56 | 57 | /* ============================================= 58 | //Section: Print Styles (partially from Sunburn Theme) 59 | //================================================ */ 60 | @media print { 61 | pre.prettyprinted, pre.prettyprint, code.prettyprint { 62 | background-color:#fff; 63 | color:#000; 64 | -moz-border-radius:0; 65 | -webkit-border-radius:0; 66 | -o-border-radius:0; 67 | -ms-border-radius:0; 68 | -khtml-border-radius:0; 69 | border-radius:0; 70 | } 71 | 72 | pre .str, code .str { color: #060; } 73 | pre .kwd, code .kwd { color: #006; font-weight: bold; } 74 | pre .com, code .com { color: #600; font-style: italic; } 75 | pre .typ, code .typ { color: #404; font-weight: bold; } 76 | pre .lit, code .lit { color: #044; } 77 | pre .pun, code .pun { color: #440; } 78 | pre .pln, code .pln { color: #000; } 79 | pre .tag, code .tag { color: #006; font-weight: bold; } 80 | pre .atn, code .atn { color: #404; } 81 | pre .atv, code .atv { color: #060; } 82 | } 83 | -------------------------------------------------------------------------------- /src/stylesheets/style.less: -------------------------------------------------------------------------------- 1 | @import "basics"; 2 | @import "content"; 3 | @import "ionicons"; 4 | @import "header"; 5 | @import "core"; 6 | @import "menu"; 7 | @import "colors"; 8 | @import "prettify"; 9 | -------------------------------------------------------------------------------- /src/stylesheets/vibrant.less: -------------------------------------------------------------------------------- 1 | /* Vibrant Ink Theme */ 2 | /* Original theme - http://alternateidea.com/blog/articles/2006/1/3/textmate-vibrant-ink-theme-and-prototype-bundle */ 3 | .prettyprint { 4 | background: black; 5 | font-family: Inconsolatas, Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace; 6 | font-size: 12px; 7 | line-height: 1.5; 8 | border: 1px solid #ccc; 9 | padding: 10px; 10 | } 11 | 12 | .pln { 13 | color: white; 14 | } 15 | 16 | @media screen { 17 | .str { 18 | color: #66ff00; 19 | } 20 | 21 | .kwd { 22 | color: #ff6600; 23 | } 24 | 25 | .com { 26 | color: #9933cc; 27 | } 28 | 29 | .typ { 30 | color: #445588; 31 | } 32 | 33 | .lit { 34 | color: #445588; 35 | } 36 | 37 | .pun { 38 | color: white; 39 | } 40 | 41 | .opn { 42 | color: white; 43 | } 44 | 45 | .clo { 46 | color: white; 47 | } 48 | 49 | .tag { 50 | color: white; 51 | } 52 | 53 | .atn { 54 | color: #99cc99; 55 | } 56 | 57 | .atv { 58 | color: #66ff00; 59 | } 60 | 61 | .dec { 62 | color: white; 63 | } 64 | 65 | .var { 66 | color: white; 67 | } 68 | 69 | .fun { 70 | color: #ffcc00; 71 | } 72 | } 73 | @media print, projection { 74 | .str { 75 | color: #006600; 76 | } 77 | 78 | .kwd { 79 | color: #006; 80 | font-weight: bold; 81 | } 82 | 83 | .com { 84 | color: #600; 85 | font-style: italic; 86 | } 87 | 88 | .typ { 89 | color: #404; 90 | font-weight: bold; 91 | } 92 | 93 | .lit { 94 | color: #004444; 95 | } 96 | 97 | .pun, .opn, .clo { 98 | color: #444400; 99 | } 100 | 101 | .tag { 102 | color: #006; 103 | font-weight: bold; 104 | } 105 | 106 | .atn { 107 | color: #440044; 108 | } 109 | 110 | .atv { 111 | color: #006600; 112 | } 113 | } 114 | /* Specify class=linenums on a pre to get line numbering */ 115 | ol.linenums { 116 | margin-top: 0; 117 | margin-bottom: 0; 118 | } 119 | 120 | /* IE indents via margin-left */ 121 | li.L0, 122 | li.L1, 123 | li.L2, 124 | li.L3, 125 | li.L4, 126 | li.L5, 127 | li.L6, 128 | li.L7, 129 | li.L8, 130 | li.L9 { 131 | /* */ 132 | } 133 | 134 | /* Alternate shading for lines */ 135 | li.L1, 136 | li.L3, 137 | li.L5, 138 | li.L7, 139 | li.L9 { 140 | /* */ 141 | } 142 | --------------------------------------------------------------------------------