diff --git a/.gitignore b/.gitignore index 3ed86a09f..5ca851962 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ _site/ *.orig *~ *.lock +.sass-cache +.jekyll-metadata +.DS_Store \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 000000000..edfc68948 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 2.5.8 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..c3f6b37e9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: ruby +rvm: +- 2.5.3 + +before_script: + - chmod +x ./cibuild.sh # or do this locally and commit + +# Assume bundler is being used, therefore +# the `install` step will run `bundle install` by default. +script: ./cibuild.sh + +env: + global: + - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer diff --git a/Gemfile b/Gemfile index 9c0465324..73c5a03d3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,5 @@ source 'https://rubygems.org' gem 'github-pages' require 'rbconfig' +gem "html-proofer", :platforms => :ruby gem 'wdm', '~> 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i diff --git a/README.md b/README.md index 1e4e8e0b6..886f02376 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,69 @@ -ev3dev.github.io +Pretty website for ev3dev [![Build Status](https://travis-ci.org/ev3dev/ev3dev.github.io.svg?branch=master)](https://travis-ci.org/ev3dev/ev3dev.github.io) ================ -This is the web page at and also . +This is the source repository for the **web page** at . If you want +to learn more about ev3dev in general, visit the site or check out our +[GitHub repo](github.com/ev3dev/ev3dev). -Feel free to fork and make a pull request. +Feel free to fork and make a pull request! If you're looking for ways to +contribute to our website, check out issues [tagged "help wanted"](https://github.com/ev3dev/ev3dev.github.io/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22); there are often tasks there +which are well-suited to new contributors. -You can view your changes locally by installing [jekyll](https://help.github.com/articles/using-jekyll-with-pages). - -Installing Jekyll in Ubuntu 14.04 +Previewing Locally --- - sudo apt-get install git ruby1.9.1 ruby1.9.1-dev nodejs - sudo gem install bundle +You can view your changes locally by installing [Jekyll](https://help.github.com/articles/using-jekyll-with-pages). + +### Installing Jekyll in Ubuntu 16.04 + +#### Install Ruby via apt-get + sudo apt-get install git ruby ruby-dev zlib1g-dev nodejs + sudo gem install bundler + +#### Install Ruby via RVM (Ruby Version Manager) +If you use ruby for other things and don't want to mess up you system ruby +installation, you can install ruby via `rvm` instead. Note that you must do the +'source' line when you open a new xterm or add it to `~/.bashrc`. + + gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 + \curl -sSL https://get.rvm.io | bash -s stable --ruby + source ~/.rvm/scripts/rvm + +You will still need to run the following too... + + sudo apt-get install git zlib1g-dev nodejs + sudo gem install bundler + +#### Check Out Code and Run Jekyll git clone git@github.com:/ev3dev.github.io cd ev3dev.github.io bundle install - bundle exec jekyll serve --watch & + bundle exec jekyll serve --safe --incremental & www-browser http://localhost:4000 & # work, work, work -Installing Jekyll in Windows ---- +### Installing Jekyll on Windows -- Follow the instructions in step 1 [here](http://jekyll-windows.juthilo.com/1-ruby-and-devkit/) (Installing Ruby and the Ruby DevKit). +First, follow the instructions in step 1 +[here](http://jekyll-windows.juthilo.com/1-ruby-and-devkit/): +"Installing Ruby and the Ruby DevKit." Then run: - gem install bundle + gem install bundler git clone https://github.com//ev3dev.github.io cd ev3dev.github.io bundle install - bundle exec jekyll serve --watch + bundle exec jekyll serve --safe --incremental -Now you should be able to visit your page at: [http://localhost:4000](http://localhost:4000). It should auto-update when you change the source files, so all you have to do is refresh your browser. +Now you should be able to visit your page at: . +It should auto-update when you change the source files, so all you have to do is +refresh your browser. Previewing Your Changes Online --- -When forking, you can create a new branch called `gh-pages`, then your -changes can be viewed as `http://.github.io/ev3dev.github.io`. When you do this -though, GitHub will send you lots of email like this, which you should ignore. - - The page build completed successfully, but returned the following warning: - - CNAME already taken: www.ev3dev.org - - For information on troubleshooting Jekyll see: - - https://help.github.com/articles/using-jekyll-with-pages#troubleshooting - - If you have any questions please contact us at https://github.com/contact. - -If it really gets on your nerves, you can rename the `CNAME` file. Just make sure to -change it back before you submit your pull request. - +After you have previewed your changes locally, you can use a special Ruby script to publish your changes using the `gh-pages` +branch of your fork of ev3dev.github.io. +If you have SSH setup for your GitHub account, simply run `./publish.rb --ssh` where `` is your actual GitHub user name. If you do not have SSH set up, use `./publish.rb `. This will copy the contents of `_site`, fix it up a bit and push it to your fork on GitHub. You can view the results at `http://.github.io/ev3dev.github.io`. diff --git a/_config.yml b/_config.yml index ee47a8018..8ad378c34 100644 --- a/_config.yml +++ b/_config.yml @@ -1,10 +1,20 @@ markdown: kramdown permalink: pretty -exclude: [README.md, Gemfile, Gemfile.lock, repo-metadata.html] +exclude: + - README.md + - Gemfile + - Gemfile.lock + - repo-metadata.html + - publish.rb + - vendor + - cibuild.sh + - .travis.yml + - maintainer-notes.md -gems: +plugins: - jekyll-mentions - jekyll-sitemap + - jekyll-redirect-from defaults: - @@ -13,25 +23,20 @@ defaults: type: "pages" values: layout: "docs" - category: "docs" + categories: "docs" - scope: path: "docs/tutorials" type: "pages" values: category: "tutorials" + layout: "tutorial" - scope: - path: "docs/drivers" + path: "docs/devtools" type: "pages" values: - category: "drivers" - - - scope: - path: "docs/sensors" - type: "pages" - values: - category: "sensors" + category: "devtools" - scope: path: "" @@ -40,11 +45,19 @@ defaults: layout: "page" - scope: - path: "" + path: "projects" type: "posts" values: layout: "project" - category: "projects" - + excerpt_separator: + - + scope: + path: "news" + type: "posts" + values: + layout: "news" + excerpt_separator: + kramdown: - toc_levels: "2,3" + toc_levels: "2,3" + input: GFM diff --git a/_data/breadcrumbs.yml b/_data/breadcrumbs.yml new file mode 100644 index 000000000..b681546aa --- /dev/null +++ b/_data/breadcrumbs.yml @@ -0,0 +1,16 @@ +docs: + name: "Documentation" + devtools: + name: Developer Tools + drivers: + name: Kernel Drivers + kernel-hackers-notebook: + name: Kernel Hacker's Notebook + motors: + name: Motors + ports: + name: Input and Output Ports + sensors: + name: Sensors + tutorials: + name: Tutorials \ No newline at end of file diff --git a/_data/langs.yml b/_data/langs.yml new file mode 100644 index 000000000..c4acd230d --- /dev/null +++ b/_data/langs.yml @@ -0,0 +1,8 @@ +js-opts: + - javascript + - js + - node + - nodejs + - node.js +python-opts: + - python \ No newline at end of file diff --git a/_data/motors.json b/_data/motors.json deleted file mode 100644 index 83d9ee0f6..000000000 --- a/_data/motors.json +++ /dev/null @@ -1,169 +0,0 @@ -[ - { - "name": "ev3-tacho-motor", - "device_type": "ev3-tacho-motor", - "class": "tacho-motor-class", - "autodetect": "Y[^ev3-large-motor]", - "vendor_name": "Firgelli", - "vendor_part_name": "L12 EV3 50mm", - "vendor_url": "http://store.firgelli.com/product_p/l12-ev3-50.htm" - }, - { - "name": "ev3-tacho-motor", - "device_type": "ev3-tacho-motor", - "class": "tacho-motor-class", - "autodetect": "Y[^ev3-large-motor]", - "vendor_name": "Firgelli", - "vendor_part_name": "L12 EV3 100mm", - "vendor_url": "http://store.firgelli.com/product_p/l12-ev3-100.htm" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_name": "Electric Technic Motor 9V Geared", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=47154c01" - }, - { - "name": "rcx-led", - "device_type": "rcx-led", - "class": "leds-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "6035", - "vendor_part_name": "Light Brick 1 x 2 with Single Side Light", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=6035" - }, - { - "name": "rcx-led", - "device_type": "rcx-led", - "class": "leds-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "6637", - "vendor_part_name": "Fiber Optics Element", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=6637" - }, - { - "name": "rcx-led", - "device_type": "rcx-led", - "class": "leds-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "8870", - "vendor_part_name": "Power Functions Light", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=8870-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "8882", - "vendor_part_name": "Power Functions XL-Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=8882-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "8883", - "vendor_part_name": "Power Functions M-Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=8883-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "9670", - "vendor_part_name": "Power Functions E-Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=9670-1" - }, - { - "name": "ev3-tacho-motor", - "device_type": "ev3-tacho-motor", - "class": "tacho-motor-class", - "autodetect": "Y[^ev3-large-motor]", - "vendor_name": "LEGO", - "vendor_part_number": "9842", - "vendor_part_name": "NXT Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=9842-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "43362", - "vendor_part_name": "Electric Technic Mini-Motor 9v", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=43362c01" - }, - { - "name": "ev3-tacho-motor", - "device_type": "ev3-tacho-motor", - "class": "tacho-motor-class", - "autodetect": "Y", - "vendor_name": "LEGO", - "vendor_part_number": "45502", - "vendor_part_name": "EV3 Large Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=45502-1" - }, - { - "name": "ev3-tacho-motor", - "device_type": "ev3-tacho-motor", - "class": "tacho-motor-class", - "autodetect": "Y", - "vendor_name": "LEGO", - "vendor_part_number": "45503", - "vendor_part_name": "EV3 Medium Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=45503-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "70823", - "vendor_part_name": "Electric Technic Micromotor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=5119-1" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "71427", - "vendor_part_name": "Electric Technic Mini-Motor 9v", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=71427c01" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "74569", - "vendor_part_name": "Electric Technic Motor 9V", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?P=2838c01" - }, - { - "name": "rcx-motor", - "device_type": "rcx-motor", - "class": "dc-motor-class", - "autodetect": "N", - "vendor_name": "LEGO", - "vendor_part_number": "88002", - "vendor_part_name": "Power Functions Train Motor", - "vendor_url": "http://www.bricklink.com/catalogItem.asp?S=88002-1" - } -] \ No newline at end of file diff --git a/_data/sensors.json b/_data/sensors.json deleted file mode 100644 index c29becbee..000000000 --- a/_data/sensors.json +++ /dev/null @@ -1,2158 +0,0 @@ -[ - { - "id": "GENERIC_EV3_ANALOG_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value", - "id": "0", - "name": "EV3-ANALOG", - "pct_max": "100", - "raw_max": "5000", - "si_max": "5000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 - 5000)" - } - ], - "name": "ev3-analog-XX", - "num_modes": "1", - "sensor_type": "ev3-analog-sensor", - "url_name": "generic-ev3-analog-sensor", - "vendor_part_name": "Generic EV3 Analog Sensor" - }, - { - "analog_mode_info": [ - { - "id": "1", - "pin5_state": "EV3_INPUT_PORT_GPIO_HIGH" - } - ], - "id": "GENERIC_NXT_ANALOG_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value", - "id": "0", - "name": "NXT-ANALOG-0", - "pct_max": "100", - "raw_max": "5000", - "si_max": "5000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 - 5000)" - }, - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value
Pin 5 high", - "id": "1", - "name": "NXT-ANALOG-1", - "pct_max": "100", - "raw_max": "5000", - "si_max": "5000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 - 5000)" - } - ], - "name": "nxt-analog", - "num_modes": "2", - "sensor_type": "nxt-analog-sensor", - "url_name": "generic-nxt-analog-sensor", - "vendor_part_name": "Generic NXT Analog Sensor" - }, - { - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - } - ], - "id": "UNKNOWN_I2C_SENSOR", - "ms_mode_info": [ - { - "description": "Unsigned 8-bit data", - "id": "0", - "name": "I2C-U8" - }, - { - "data_type": "MSENSOR_DATA_S8", - "description": "Signed 8-bit data", - "id": "1", - "name": "I2C-S8" - }, - { - "data_type": "MSENSOR_DATA_S16", - "description": "Signed 16-bit data", - "id": "2", - "name": "I2C-S16" - } - ], - "name": "nxt-i2c", - "num_modes": "3", - "product_id": "unknown", - "sensor_type": "nxt-i2c-sensor", - "url_name": "unknown-nxt-i2c-sensor", - "vendor_id": "UNKNOWN", - "vendor_part_name": "Unknown NXT I2C Sensor" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0" - }, - { - "id": "5", - "read_data_reg": "0" - }, - { - "id": "6", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_COLOR_SENSOR", - "ms_mode_info": [ - { - "description": "Color", - "id": "0", - "name": "HT-COL1-COL", - "notes": "\n[^color-value]: Color Values:
\n ![Color chart](http://www.hitechnic.com/contents/media/Color%20Number.jpg)\n \n ", - "raw_max": "17", - "si_max": "17", - "value0": "Color (0 to 17)", - "value0_footnote": "[^color-value]" - }, - { - "description": "Red component", - "id": "1", - "name": "HT-COL1-RED", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Green component", - "id": "2", - "name": "HT-COL1-GRN", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Blue component", - "id": "3", - "name": "HT-COL1-BLU", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "data_sets": "3", - "data_type": "MSENSOR_DATA_U16", - "description": "Raw values", - "id": "4", - "name": "HT-COL1-RAW", - "raw_max": "USHRT_MAX", - "si_max": "USHRT_MAX", - "value0": "Red Component (0 to 255)", - "value1": "Green Component (0 to 255)", - "value2": "Blue Component (0 to 255)" - }, - { - "data_sets": "4", - "description": "Normalized values", - "id": "5", - "name": "HT-COL1-NRM", - "value0": "Red Component (0 to 255)", - "value1": "Green Component (0 to 255)", - "value2": "Blue Component (0 to 255)", - "value3": "??? Component (0 to 255)" - }, - { - "data_sets": "4", - "description": "All values", - "id": "6", - "name": "HT-COL1-ALL", - "value0": "Color (0 to 17)", - "value0_footnote": "[^color-value]", - "value1": "Red Component (0 to 255)", - "value2": "Green Component (0 to 255)", - "value3": "Blue Component (0 to 255)" - } - ], - "name": "ht-nxt-color", - "num_modes": "7", - "product_id": "Color", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-color-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Color Sensor" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - } - ], - "id": "HT_NXT_ANGLE_SENSOR", - "ms_mode_info": [ - { - "description": "Angle", - "id": "0", - "name": "HT-ANG-DEG2", - "raw_max": "180", - "si_max": "180", - "units": "deg", - "units_description": "degrees", - "value0": "Angle (0 to 180)" - }, - { - "data_type": "MSENSOR_DATA_S32", - "description": "Accumulated angle", - "figures": "9", - "id": "1", - "name": "HT-ANG-ACC", - "raw_max": "INT_MAX", - "raw_min": "INT_MIN", - "si_max": "INT_MAX", - "si_min": "INT_MIN", - "units": "deg", - "units_description": "degrees", - "value0": "Angle (-2147483648 to 2147483647)" - }, - { - "data_type": "MSENSOR_DATA_S16", - "description": "Rotational speed", - "id": "2", - "name": "HT-ANG-RPM", - "raw_max": "SHRT_MAX", - "raw_min": "SHRT_MIN", - "si_max": "SHRT_MAX", - "si_min": "SHRT_MIN", - "units": "RPM", - "units_description": "revolutions per minute", - "value0": "Angle (-32768 to 32768)" - }, - { - "description": "Reset angle", - "id": "3", - "name": "HT-ANG-RSET", - "name_footnote": "[^mode3]", - "notes": "\n[^mode3]: `HT-ANG-RSET` mode is exactly the same as `HT-ANG-DEG2` except\n that the angle is reset each time the mode is set to `HT-ANG-RSET`.\n \n ", - "raw_max": "180", - "si_max": "180", - "units": "deg", - "units_description": "degrees", - "value0": "Angle (0 to 180)" - } - ], - "name": "ht-nxt-angle", - "num_modes": "4", - "num_read_only_modes": "3", - "product_id": "AnglSnsr", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-angle-sensor", - "vendor_id": "HITECHNC", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Angle Sensor", - "vendor_part_number": "NAA1030", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NAA1030" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_ACCELERATION_TILT_SENSOR", - "ms_mode_info": [ - { - "description": "Single-axis acceleration", - "id": "0", - "name": "HT-ACCL", - "notes": "\n[^mode-0-value]: Value is 8 most significant bits out of 10-bit total resolution.\n \n ", - "value0": "Acceleration (coarse value)", - "value0_footnote": "[^mode-0-value]" - }, - { - "data_sets": "6", - "description": "Three-axis acceleration", - "id": "1", - "name": "HT-ACCL-ALL", - "notes": "\n[^mode-1-value]: Only the 2 most significant bits are used.\n Actual value is `MSB << 2 + LSB >> 6` or `MSB << 2 + LSB & 0x03`\n (can someone confirm which one?).\n \n ", - "value0": "X-axis acceleration (most significant byte)", - "value1": "Y-axis acceleration (most significant byte)", - "value2": "Z-axis acceleration (most significant byte)", - "value3": "X-axis acceleration (least significant byte)", - "value3_footnote": "[^mode-1-value]", - "value4": "Y-axis acceleration (least significant byte)", - "value4_footnote": "[^mode-1-value]", - "value5": "Z-axis acceleration (least significant byte)", - "value5_footnote": "[^mode-1-value]" - } - ], - "name": "ht-nxt-accel", - "num_modes": "2", - "product_id": "Accel.", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-acceleration-tilt-sensor", - "vendor_id": "HITECHNC", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Acceleration / Tilt Sensor", - "vendor_part_number": "NAC1040", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NAC1040" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_BAROMETRIC_SENSOR", - "ms_mode_info": [ - { - "decimals": "1", - "description": "Barometric Pressure", - "id": "0", - "name": "HT-BAR-PRES", - "raw_max": "29400", - "raw_min": "30400", - "si_max": "3000", - "units": "m", - "units_description": "???", - "value0": "Absolute Pressure (0 to 3000)" - }, - { - "decimals": "1", - "description": "Temperature", - "id": "1", - "name": "HT-BAR-TEMP", - "raw_max": "1000", - "si_max": "1000", - "units": "C", - "units_description": "degrees Celsius", - "value0": "Absolute Pressure (0 to 1000)" - } - ], - "name": "ht-nxt-barometric", - "num_modes": "2", - "product_id": "Barometr", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-barometric-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Barometric Sensor", - "vendor_part_number": "NBR1036", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NBR1036" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "5", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "6", - "read_data_reg": "0", - "set_mode_reg": "0" - }, - { - "id": "7", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - } - ], - "id": "HT_NXT_COLOR_SENSOR_V2", - "ms_mode_info": [ - { - "description": "Color", - "id": "0", - "name": "HT-COL2-COL", - "notes": "\n[^color-value]: Color Values:
\n ![Color chart](http://www.hitechnic.com/contents/media/Color%20Number.jpg)\n \n ", - "raw_max": "17", - "si_max": "17", - "value0": "Color (0 to 17)", - "value0_footnote": "[^color-value]" - }, - { - "description": "Red component", - "id": "1", - "name": "HT-COL2-RED", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Green component", - "id": "2", - "name": "HT-COL2-GRN", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Blue component", - "id": "3", - "name": "HT-COL2-BLU", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "White component", - "id": "4", - "name": "HT-COL2-WHT", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "data_sets": "4", - "description": "Normalized values", - "id": "5", - "name": "HT-COL2-NRM", - "value0": "Red Component (0 to 255)", - "value1": "Green Component (0 to 255)", - "value2": "Blue Component (0 to 255)", - "value3": "White Component (0 to 255)" - }, - { - "data_sets": "5", - "description": "All values", - "id": "6", - "name": "HT-COL2-ALL", - "value0": "Red Component (0 to 255)", - "value1": "Green Component (0 to 255)", - "value2": "Blue Component (0 to 255)", - "value3": "White Component (0 to 255)", - "value4": "??? (0 to 255)" - }, - { - "data_sets": "4", - "data_type": "MSENSOR_DATA_U16", - "description": "Raw values", - "id": "7", - "name": "HT-COL2-RAW", - "raw_max": "USHRT_MAX", - "si_max": "USHRT_MAX", - "value0": "Red Component (0 to 255)", - "value1": "Green Component (0 to 255)", - "value2": "Blue Component (0 to 255)", - "value3": "White Component (0 to 255)" - } - ], - "name": "ht-nxt-color-v2", - "num_modes": "8", - "num_read_only_modes": "7", - "product_id": "ColorPD", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-color-sensor-v2", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Color Sensor V2", - "vendor_part_number": "NCO1038", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NCO1038" - }, - { - "analog_mode_info": [ - { - "analog_cb": "ht_eopd_sensor_cb", - "id": "0", - "pin5_state": "EV3_INPUT_PORT_GPIO_HIGH" - }, - { - "analog_cb": "ht_eopd_sensor_cb", - "id": "1", - "pin5_state": "EV3_INPUT_PORT_GPIO_LOW" - } - ], - "id": "HT_EOPD_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "description": "Proximity (long range)", - "id": "0", - "name": "HT-EOPD-L", - "notes": "\n[^adjusted-value]: This value is the square root of the\n raw value. You can derive a value proportional (linear)\n to distance by dividing a constant by this value,\n e.g. `35 / value0`.\n \n ", - "pct_max": "100", - "raw_max": "5000", - "si_max": "100", - "value0": "Proximity (0-100)", - "value0_footnote": "[^adjusted-value]" - }, - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "description": "Proximity (short range)", - "id": "1", - "name": "HT-EOPD-S", - "pct_max": "100", - "raw_max": "5000", - "si_max": "100", - "value0": "Proximity (0-100)", - "value0_footnote": "[^adjusted-value]" - } - ], - "name": "ht-nxt-eopd", - "num_modes": "2", - "sensor_type": "nxt-analog-sensor", - "url_name": "hitechnic-nxt-eopd", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT EOPD", - "vendor_part_number": "NEO1048", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NEO1048" - }, - { - "id": "HT_FORCE_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "description": "Raw value (non-linear)", - "id": "0", - "name": "HT-FORCE", - "pct_max": "100", - "raw_max": "5000", - "si_max": "1023", - "value0": "(0-1023)" - } - ], - "name": "ht-nxt-force", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "url_name": "hitechnic-nxt-force-sensor", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Force Sensor", - "vendor_part_number": "NFS1074", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NFS1074" - }, - { - "id": "HT_GYRO_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "description": "Angular speed", - "id": "0", - "name": "HT-GYRO", - "pct_max": "100", - "raw_max": "4880", - "si_max": "400", - "si_min": "-540", - "units": "d/s", - "units_description": "degrees per second", - "value0": "Angular speed (-540 to 400)" - } - ], - "name": "ht-nxt-gyro", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "url_name": "hitechnic-nxt-gyro-sensor", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Gyro Sensor", - "vendor_part_number": "NGY1044", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NGY1044" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_IR_LINK_SENSOR", - "ms_mode_info": [ - { - "description": "???", - "id": "0", - "name": "HT-IRLINK", - "value0": "???" - } - ], - "name": "ht-nxt-ir-link", - "num_modes": "1", - "product_id": "IRLink", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-irlink-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT IRLink Sensor", - "vendor_part_number": "NIL1046", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NIL1046" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_IR_RECEIVER_SENSOR", - "ms_mode_info": [ - { - "data_type": "MSENSOR_DATA_S8", - "description": "Single Motor Control", - "id": "0", - "name": "HT-IRRECV", - "notes": "\n[^values]: Value of -128 is brake. Speed values only occur in\n discrete steps (-100, -86, -72, -58, -44, -30, -16, 0, 16, 30,\n 44, 58, 72, 86 and 100).\n \n ", - "units": "pct", - "units_description": "percent", - "value0": "Motor 1A Speed (-128 and -100 to 100)", - "value0_footnote": "[^values],[^value-map]" - }, - { - "data_sets": "8", - "data_type": "MSENSOR_DATA_S8", - "description": "Eight Motor Controls", - "id": "1", - "name": "HT-IRRECV-8", - "notes": "\n[^value-map]: In \"Motor NX\", the number is the channel,\n A is the red/left control and B is the blue/right control.\n \n ", - "units": "pct", - "units_description": "percent", - "value0": "Motor 1A Speed (-128 and -100 to 100)", - "value0_footnote": "[^values],[^value-map]", - "value1": "Motor 1B Speed (-128 and -100 to 100)", - "value1_footnote": "[^values],[^value-map]", - "value2": "Motor 2A Speed (-128 and -100 to 100)", - "value2_footnote": "[^values],[^value-map]", - "value3": "Motor 2B Speed (-128 and -100 to 100)", - "value3_footnote": "[^values],[^value-map]", - "value4": "Motor 3A Speed (-128 and -100 to 100)", - "value4_footnote": "[^values],[^value-map]", - "value5": "Motor 3B Speed (-128 and -100 to 100)", - "value5_footnote": "[^values],[^value-map]", - "value6": "Motor 4A Speed (-128 and -100 to 100)", - "value6_footnote": "[^values],[^value-map]", - "value7": "Motor 4B Speed (-128 and -100 to 100)", - "value7_footnote": "[^values],[^value-map]" - } - ], - "name": "ht-nxt-ir-receiver", - "num_modes": "2", - "product_id": "IRRecv", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-irreceiver-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT IRReceiver Sensor", - "vendor_part_number": "NIR1032", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NIR1032" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_PIR_SENSOR", - "ms_mode_info": [ - { - "description": "IR Proximity", - "id": "0", - "name": "HT-PIR", - "pct_min": "-100", - "si_max": "100", - "si_min": "-100", - "units": "pct", - "units_description": "percent", - "value0": "Proximity (-100 to 100)" - } - ], - "name": "ht-nxt-pir", - "num_modes": "1", - "product_id": "PIR", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-pir-sensor", - "vendor_id": "HITECHNC", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT PIR Sensor", - "vendor_part_number": "NIS1070", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NIS1070" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_COMPASS_SENSOR", - "ms_mode_info": [ - { - "data_type": "MSENSOR_DATA_S8", - "description": "Compass Direction", - "id": "0", - "name": "HT-CMP-DEG2", - "raw_max": "180", - "si_max": "180", - "units": "deg", - "units_description": "degrees", - "value0": "Direction (-180 to 180)" - } - ], - "name": "ht-nxt-compass", - "num_modes": "1", - "product_id": "Compass", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-compass-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Compass Sensor", - "vendor_part_number": "NMC1034", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMC1034" - }, - { - "id": "HT_MAGNETIC_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "description": "Magnetic field???", - "id": "0", - "name": "HT-MAG", - "pct_max": "100", - "raw_max": "5000", - "si_max": "1023", - "value0": "???" - } - ], - "name": "ht-nxt-mag", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "url_name": "hitechnic-nxt-magnetic-sensor", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Magnetic Sensor", - "vendor_part_number": "NMS1035", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMS1035" - }, - { - "default_address": "0x08", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_IR_SEEKER_SENSOR_V2", - "ms_mode_info": [ - { - "description": "Direction (unmodulated)", - "id": "0", - "name": "HT-DIR-DC", - "notes": "\n[^values]: Direction values:\n \n | Value | Description |\n |-------|-------------|\n | 0 | No signal |\n | 1 | Far left |\n | ... | |\n | 5 | Center |\n | ... | |\n | 9 | Far right |\n \n ", - "raw_max": "9", - "si_max": "9", - "value0": "Direction (0 to 9)", - "value0_footnote": "[^values]" - }, - { - "description": "Direction (modulated)", - "id": "1", - "name": "HT-DIR-AC", - "raw_max": "9", - "si_max": "9", - "value0": "Direction (0 to 9)", - "value0_footnote": "[^values]" - }, - { - "data_sets": "7", - "description": "All values (unmodulated)", - "id": "2", - "name": "HT-DIR-DALL", - "value0": "Direction (0 to 9)", - "value0_footnote": "[^values]", - "value1": "Sensor 1 signal strength (0 to 9)", - "value1_footnote": "[^values]", - "value2": "Sensor 2 signal strength (0 to 9)", - "value2_footnote": "[^values]", - "value3": "Sensor 3 signal strength (0 to 9)", - "value3_footnote": "[^values]", - "value4": "Sensor 4 signal strength (0 to 9)", - "value4_footnote": "[^values]", - "value5": "Sensor 5 signal strength (0 to 9)", - "value5_footnote": "[^values]", - "value6": "Sensor mean (0 to 9)", - "value6_footnote": "[^values]" - }, - { - "data_sets": "6", - "description": "All values (modulated)", - "id": "3", - "name": "HT-DIR-AALL", - "value0": "Direction (0 to 9)", - "value0_footnote": "[^values]", - "value1": "Sensor 1 signal strength (0 to 9)", - "value1_footnote": "[^values]", - "value2": "Sensor 2 signal strength (0 to 9)", - "value2_footnote": "[^values]", - "value3": "Sensor 3 signal strength (0 to 9)", - "value3_footnote": "[^values]", - "value4": "Sensor 4 signal strength (0 to 9)", - "value4_footnote": "[^values]", - "value5": "Sensor 5 signal strength (0 to 9)", - "value5_footnote": "[^values]" - } - ], - "name": "ht-nxt-ir-seeker-v2", - "num_modes": "4", - "product_id": "NewIRDir", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-irseeker-v2", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT IRSeeker V2", - "vendor_part_number": "NSK1042", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSK1042" - }, - { - "default_address": "0x08", - "device_class_footnote": "[^more-devices]", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0", - "set_mode_data": "2", - "set_mode_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0", - "set_mode_data": "1", - "set_mode_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - } - ], - "id": "HT_NXT_SENSOR_MUX", - "ms_mode_info": [ - { - "data_sets": "2", - "description": "Run mode (polling attached sensors)", - "id": "0", - "name": "HT-SMUX-RUN", - "notes": "\n[^mode]: Actual mode:\n \n | Value | Description |\n |-------|-------------|\n | 0 | Halt |\n | 1 | Detect |\n | 2 | Run |\n \n \n[^status-bits]: Status bits:\n \n | Bit | Description |\n |-----|----------------|\n | 0 | Low/no battery |\n | 1 | Running |\n | 2 | Halted |\n | 3 | Error |\n \n ", - "value0": "Mode", - "value0_footnote": "[^mode]", - "value1": "Status", - "value1_footnote": "[^status-bits]" - }, - { - "data_sets": "2", - "description": "Start auto-detection", - "id": "1", - "name": "HT-SMUX-DETECT", - "name_footnote": "[^auto-detect-mode],[^auto-detect-sensors]", - "notes": "\n[^auto-detect-mode]: The sensor must be in `HT-SMUX-HALT` mode before\n entering `HT-SMUX-DETECT` mode. Attempting to set `HT-SMUX-DETECT`\n mode from `HT-SMUX-RUN` mode will result in an error (-EPERM).\n \n \n[^auto-detect-sensors]: Only these sensors can be auto-detected:\n \n - LEGO NXT Ultrasonic\n - HiTechnic NXT Compass\n - HiTechnic NXT Color\n - HiTechnic NXT Acceleration / Tilt\n - HiTechnic NXT IR Seeker\n - HiTechnic Super Pro\n - HiTechnic NXT Color V2\n - HiTechnic NXT IR Seeker V2\n ", - "value0": "Mode", - "value0_footnote": "[^mode]", - "value1": "Status", - "value1_footnote": "[^status-bits]" - }, - { - "data_sets": "2", - "description": "Halt mode (not polling)", - "id": "2", - "name": "HT-SMUX-HALT", - "value0": "Mode", - "value0_footnote": "[^mode]", - "value1": "Status", - "value1_footnote": "[^status-bits]" - } - ], - "name": "ht-nxt-smux", - "notes": "\n[^more-devices]: The `ht-nxt-smux` driver loads more devices in addition to\n the [msensor] device. See [ht-smux-input-port](../ht-smux-input-port) for\n more information.\n \n ", - "num_modes": "3", - "num_read_only_modes": "1", - "ops.poll_cb": "ht_sensor_mux_poll_cb", - "ops.remove_cb": "ht_sensor_mux_remove_cb", - "ops.set_mode_post_cb": "ht_sensor_mux_set_mode_post_cb", - "ops.set_mode_pre_cb": "ht_sensor_mux_set_mode_pre_cb", - "product_id": "SensrMUX", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-sensor-multiplexer", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Sensor Multiplexer", - "vendor_part_number": "NSX2020", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSX2020" - }, - { - "default_address": "0x08", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0" - }, - { - "id": "5", - "read_data_reg": "0" - }, - { - "id": "6", - "read_data_reg": "0" - }, - { - "id": "7", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_SUPER_PRO_SENSOR", - "ms_mode_info": [ - { - "data_sets": "4", - "data_type": "MSENSOR_DATA_U16", - "description": "Analog inputs", - "id": "0", - "name": "HT-SPRO-AIN", - "value0": "Analog input A0 (0 to 1023)", - "value1": "Analog input A1 (0 to 1023)", - "value2": "Analog input A2 (0 to 1023)", - "value3": "Analog input A3 (0 to 1023)" - }, - { - "description": "Digital inputs", - "id": "1", - "name": "HT-SPRO-DIN", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Digital outputs", - "id": "2", - "name": "HT-SPRO-DOT", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Digital input/output controls", - "id": "3", - "name": "HT-SPRO-DCT", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Strobe output", - "id": "4", - "name": "HT-SPRO-STB", - "value0": "Bits S0-S3 (0 to 15)" - }, - { - "description": "LED control", - "id": "5", - "name": "HT-SPRO-LED", - "notes": "\n[^led-states]: LED states:\n \n | Value | Description |\n |-------|--------------|\n | 0 | None |\n | 1 | Red |\n | 2 | Blue |\n | 3 | Red and blue |\n \n ", - "value0": "LED state", - "value0_footnote": "[^led-states]" - }, - { - "data_sets": "5", - "description": "Analog output O0", - "id": "6", - "name": "HT-SPRO-AO0", - "value0": "Mode", - "value1": "Frequency, most significant byte", - "value2": "Frequency, least significant byte", - "value3": "Voltage, most significant byte", - "value4": "Voltage, least significant byte" - }, - { - "data_sets": "5", - "description": "Analog output O1", - "id": "7", - "name": "HT-SPRO-AO1", - "value0": "Mode", - "value1": "Frequency, most significant byte", - "value2": "Frequency, least significant byte", - "value3": "Voltage, most significant byte", - "value4": "Voltage, least significant byte" - } - ], - "name": "ht-super-pro", - "num_modes": "5", - "product_id": "SuperPro", - "sensor_type": "nxt-i2c-sensor", - "url_name": "hitechnic-nxt-superpro-prototype-board", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT SuperPro Prototype Board", - "vendor_part_number": "SPR2010", - "vendor_website": "http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=SPR2010" - }, - { - "id": "LEGO_EV3_ULTRASONIC", - "ms_mode_info": [ - { - "decimals": "1", - "description": "Continuous measurement
LEDs: On, steady", - "id": "0", - "name": "US-DIST-CM", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0-2550)" - }, - { - "decimals": "1", - "description": "Continuous measurement
LEDs: On, steady", - "id": "1", - "name": "US-DIST-IN", - "units": "in", - "units_description": "inches", - "value0": "Distance (0-1003)" - }, - { - "description": "Listen
LEDs: On, blinking", - "id": "2", - "name": "US-LISTEN", - "notes": "\n[^listen-value]: A value of `1` indicates that another ultrasonic\n sensor has been detected. A `1` can also be triggered by a loud\n noise such as clapping.\n \n ", - "value0": "Presence (0-1)", - "value0_footnote": "[^listen-value]" - }, - { - "decimals": "1", - "description": "Single measurement
LEDs: On momentarily when mode is set, then off", - "id": "3", - "name": "US-SI-CM", - "notes": "\n[^single-measurement]: A measurement is taken when the mode is set\n and `value0` will not change after this. To take another measurement\n set the mode again. **NOTE:** If you write the mode too frequently\n (e.g. every 100msec), the sensor will sometimes lock up and writing\n to the `mode` attribute will return an error. A delay of 250msec\n between each write to the mode attribute seems sufficient to keep\n the sensor from locking up.\n \n ", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0-2550)", - "value0_footnote": "[^single-measurement]" - }, - { - "decimals": "1", - "description": "Single measurement
LEDs: On momentarily when mode is set, then off", - "id": "4", - "name": "US-SI-IN", - "units": "in", - "units_description": "inches", - "value0": "Distance (0-1003)", - "value0_footnote": "[^single-measurement]" - }, - { - "decimals": "1", - "description": "???
LEDs: On, steady", - "id": "5", - "name": "US-DC-CM", - "name_footnote": "[^dc-mode]", - "notes": "\n[^dc-mode]: Not sure what DC mode stands for.\n Seems to work like the continuous measurement modes.\n \n ", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0-2550)" - }, - { - "decimals": "1", - "description": "???
LEDs: On, steady", - "id": "6", - "name": "US-DC-IN", - "name_footnote": "[^dc-mode]", - "units": "in", - "units_description": "inches", - "value0": "Distance (0-1003)" - } - ], - "name": "ev3-uart-30", - "num_modes": "5", - "sensor_type": "legoev3-uart", - "url_name": "lego-ev3-ultrasonic-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Ultrasonic Sensor", - "vendor_part_number": "45504" - }, - { - "id": "LEGO_EV3_GYRO", - "ms_mode_info": [ - { - "description": "Angle", - "id": "0", - "name": "GYRO-ANG", - "name_footnote": "[^angle-reset]", - "notes": "\n[^angle-reset]: The angle in GYRO-ANG or GYRO-G&A modes can\n be reset by changing to a different mode and changing back.\n \n \n[^angle-overflow]: If you spin around too many times\n in GYRO-ANG or GYRO-G&A mode, it will get stuck at 32767.\n \n \n[^direction]: Clockwise is positive when looking at the side\n of the sensor with the arrows.\n \n ", - "units": "deg", - "units_description": "degrees", - "value0": "Angle (-32768 to 32767)", - "value0_footnote": "[^angle-overflow],[^direction]" - }, - { - "description": "Rotational Speed", - "id": "1", - "name": "GYRO-RATE", - "name_footnote": "[^calibration]", - "notes": "\n[^calibration]: The sensor is calibrated when the\n GYRO-RATE or the GYRO-G&A mode is set. If the sensor is\n moving when setting the mode, the calibration will be off.\n \n ", - "units": "d/s", - "units_description": "degrees per second", - "value0": "Rotational Speed (-440 to 440)", - "value0_footnote": "[^direction]" - }, - { - "description": "Raw sensor value ???", - "id": "2", - "name": " GYRO-FAS", - "value0": "??? (-1464 to 1535)", - "value0_footnote": "[^direction]" - }, - { - "data_sets": "2", - "description": "Angle and Rotational Speed", - "id": "3", - "name": "GYRO-G&A", - "name_footnote": "[^angle-reset],[^calibration]", - "value0": "Angle (-32768 to 32767)", - "value0_footnote": "[^angle-overflow],[^direction]", - "value1": "Rotational Speed (-440 to 440)", - "value1_footnote": "[^direction]" - }, - { - "data_sets": "4", - "description": "Calibration ???", - "id": "4", - "name": "GYRO-CAL", - "value0": "???", - "value1": "???", - "value2": "???", - "value3": "???" - } - ], - "name": "ev3-uart-32", - "num_modes": "5", - "sensor_type": "legoev3-uart", - "url_name": "lego-ev3-gyro-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Gyro Sensor", - "vendor_part_number": "45505" - }, - { - "id": "LEGO_EV3_COLOR", - "ms_mode_info": [ - { - "description": "Reflected light
Red LED on", - "id": "0", - "name": "COL-REFLECT", - "units": "pct", - "units_description": "percent", - "value0": "Reflected light intensity (0 to 100)" - }, - { - "description": "Ambient light
Red LEDs off", - "id": "1", - "name": "COL-AMBIENT", - "units": "pct", - "units_description": "percent", - "value0": "Ambient light intensity (0 to 100)" - }, - { - "description": "Color
All LEDs rapidly cycling, appears white", - "id": "2", - "name": "COL-AMBIENT", - "notes": "\n[^color-values]: Color values:\n \n | Value | Color |\n |-------|--------|\n | 0 | none |\n | 1 | black |\n | 2 | blue |\n | 3 | green |\n | 4 | yellow |\n | 5 | red |\n | 6 | white |\n | 7 | brown |\n \n ", - "units": "col", - "units_description": "color", - "value0": "Detected color (0 to 7)", - "value0_footnote": "[^color-values]" - }, - { - "data_sets": "2", - "description": "Raw Reflected
Red LED on", - "id": "3", - "name": "REF-RAW", - "value0": "??? (0 to 1020???)", - "value1": "??? (0 to 1020???)" - }, - { - "data_sets": "3", - "description": "Raw Color Components
All LEDs rapidly cycling, appears white", - "id": "4", - "name": "RGB-RAW", - "units_description": "color", - "value0": "Red??? (0 to 1020???)", - "value1": "Blue??? (0 to 1020???)" - }, - { - "data_sets": "4", - "description": "Calibration ???
All LEDs rapidly cycling, appears white", - "id": "5", - "name": "COL-CAL", - "name_footnote": "[^cal-mode]", - "notes": "\n[^cal-mode]: This mode is not usable. When in COL-CAL mode,\n the color sensor does not respond to the keep-alive sent from\n the EV3 brick. As a result, the sensor will time out and reset.\n \n ", - "value0": "???", - "value1": "???", - "value2": "???", - "value3": "???" - } - ], - "name": "ev3-uart-29", - "num_modes": "6", - "sensor_type": "legoev3-uart", - "url_name": "lego-ev3-color-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Color Sensor", - "vendor_part_number": "45506" - }, - { - "analog_mode_info": [ - { - "analog_cb": "ev3_touch_sensor_cb", - "id": "0" - } - ], - "id": "LEGO_EV3_TOUCH_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "description": "Button state", - "id": "0", - "name": "TOUCH", - "notes": "\n[^mode0-value]: Values:\n \n | Value | Description |\n |:-----:|:-----------:|\n | `0` | Released |\n | `1` | Pressed |\n \n ", - "pct_max": "100", - "raw_max": "1", - "si_max": "1", - "value0": "State (0 or 1)", - "value0_footnote": "[^mode0-value]" - } - ], - "name": "lego-ev3-touch", - "num_modes": "1", - "sensor_type": "ev3-analog-sensor", - "url_name": "lego-ev3-touch-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Touch Sensor", - "vendor_part_number": "45507" - }, - { - "id": "LEGO_EV3_INFRARED", - "ms_mode_info": [ - { - "description": "Proximity", - "id": "0", - "name": "IR-PROX", - "notes": "\n[^distance-value]: 100% is approximately 70cm/27in.\n \n ", - "units": "pct", - "units_description": "percent", - "value0": "Distance (0 to 100)", - "value0_footnote": "[^distance-value]" - }, - { - "data_sets": "8", - "description": "IR Seeker", - "id": "1", - "name": "IR-SEEK", - "notes": "\n[^heading-value]: When looking in the same direction as the\n sensor, -25 is far left and +25 is far right.\n \n \n[^no-beacon]: The absence of a beacon on a channel can be\n detected when distance == -128 (and heading == 0).\n \n ", - "units": "pct", - "units_description": "percent", - "value0": "Channel 1 Heading (-25 to 25)", - "value0_footnote": "[^heading-value]", - "value1": "Channel 1 Distance (-128 and 0 to 100)", - "value1_footnote": "[^distance-value],[^no-beacon]", - "value2": "Channel 2 Heading (-25 to 25)", - "value2_footnote": "[^heading-value]", - "value3": "Channel 2 Distance (-128 and 0 to 100)", - "value3_footnote": "[^distance-value],[^no-beacon]", - "value4": "Channel 3 Heading (-25 to 25)", - "value4_footnote": "[^heading-value]", - "value5": "Channel 3 Distance (-128 and 0 to 100)", - "value5_footnote": "[^distance-value],[^no-beacon]", - "value6": "Channel 4 Heading (-25 to 25)", - "value6_footnote": "[^heading-value]", - "value7": "Channel 4 Distance (-128 and 0 to 100)", - "value7_footnote": "[^distance-value],[^no-beacon]" - }, - { - "data_sets": "4", - "description": "IR Remote Control", - "id": "2", - "name": "IR-REMOTE", - "notes": "\n[^remote-mode-values]: Button values:\n \n | Value | Description |\n |-------|------------------------|\n | 0 | none |\n | 1 | red up |\n | 2 | red down |\n | 3 | blue up |\n | 4 | blue down |\n | 5 | red up and blue up |\n | 6 | red up and blue down |\n | 7 | red down and blue up |\n | 8 | red down and blue down |\n | 9 | beacon mode on |\n | 10 | red up and red down |\n | 11 | blue up and blue down |\n \n red == left and blue == right\n \n Pressing more that 2 buttons at one time is not supported.\n It will usually read 0. Pressing an up/down button while\n beacon mode is activated with turn off beacon mode.\n \n ", - "units": "btn", - "units_description": "button", - "value0": "Channel 1 (0 to 11)", - "value0_footnote": "[^remote-mode-values]", - "value1": "Channel 2 (0 to 11)", - "value1_footnote": "[^remote-mode-values]", - "value2": "Channel 3 (0 to 11)", - "value2_footnote": "[^remote-mode-values]", - "value3": "Channel 4 (0 to 11)", - "value3_footnote": "[^remote-mode-values]" - }, - { - "description": "IR Remote Control", - "id": "3", - "name": "IR-REM-A", - "notes": "\n[^alt-remote-mode-values]: Button values:\n \n | Value | Blue Down | Blue Up | Red Down | Red Up |\n |:-------:|:---------:|:-------:|:--------:|:------:|\n | 262/384 | | | | |\n | 287 | | | | X |\n | 300 | | | X | |\n | 309 | | | X | X |\n | 330 | | X | | |\n | 339 | | X | | X |\n | 352 | | X | X | |\n | 377 | | X | X | X |\n | 390 | X | | | |\n | 415 | X | | | X |\n | 428 | X | | X | |\n | 437 | X | | X | X |\n | 458 | X | X | | |\n | 467 | X | X | | X |\n | 480 | X | X | X | |\n | 505 | X | X | X | X |\n \n X = button pressed\n \n The most significant byte is always 0x01. In the least\n significant byte, the 4 most significant bits represent\n each button. Bit 7 is the blue down button, bit 6 is the\n blue up button, bit 5 is the red down button, bit 4 is the\n red up button. Beware that when no buttons are pressed,\n bit 7 is set (value == 384). You can test that bits 0-3\n are all 0 to check this.\n \n
if ((value & 0x0F) == 0) {\n        // no buttons are pressed\n    } else {\n        if (value & 0x80)\n            // blue down button is pressed\n        if (value & 0x40)\n            // blue up button is pressed\n        if (value & 0x20)\n            // red down button is pressed\n        if (value & 0x10)\n            // red up button is pressed\n    }\n    
\n \n Bits 0-3 seem to be some sort of checksum or parity check.\n Bit 0 = bit 4, bit 1 = ~(bit 5), bit 2 = ~(bit 6),\n bit 3 = 0 if bits 0-2 are even or 1 if bits 0-2 are odd.\n \n Also, when the beacon mode is active or for about 1 second\n after any button is released the value is 262.\n \n This mode only works with the remote on channel 1.\n \n ", - "value0": "Channel 1", - "value0_footnote": "[^alt-remote-mode-values]" - }, - { - "data_sets": "4", - "description": "Alternate IR Seeker ???", - "id": "4", - "name": "IR-S-ALT", - "name_footnote": "[^alt-seeker-mode]", - "notes": "\n[^alt-seeker-mode]: `IR-S-ALT` mode is not usable.\n When switching to this mode, the sensor quits responding\n to the keep-alive messages and the sensor resets.\n \n ", - "units": "pct", - "value0": "??? (0 to 100)", - "value1": "??? (0 to 100)", - "value2": "??? (0 to 100)", - "value3": "??? (0 to 100)" - }, - { - "data_sets": "2", - "description": "Calibration ???", - "id": "5", - "name": "IR-CAL", - "value0": "??? (0 to 1023)", - "value1": "??? (0 to 1023)" - } - ], - "name": "ev3-uart-33", - "num_modes": "6", - "sensor_type": "legoev3-uart", - "url_name": "lego-ev3-infrared-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Infrared Sensor", - "vendor_part_number": "45509" - }, - { - "default_address": "0x02", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0" - }, - { - "id": "5", - "read_data_reg": "0" - }, - { - "id": "6", - "read_data_reg": "0" - }, - { - "id": "7", - "read_data_reg": "0" - } - ], - "id": "LEGO_POWER_STORAGE_SENSOR", - "ms_mode_info": [ - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Voltage", - "id": "0", - "name": "ES-IN-VOLT", - "raw_max": "10000", - "si_max": "10000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 to 10000)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Current", - "id": "1", - "name": "ES-IN-AMP", - "raw_max": "10000", - "si_max": "10000", - "units": "A", - "units_description": "amps", - "value0": "Current (0 to 10000)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Voltage", - "id": "2", - "name": "ES-OUT-VOLT", - "raw_max": "10000", - "si_max": "10000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 to 10000)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Current", - "id": "3", - "name": "ES-OUT-AMP", - "raw_max": "10000", - "si_max": "10000", - "units": "A", - "units_description": "amps", - "value0": "Current (0 to 10000)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "description": "Energy", - "id": "4", - "name": "ES-JOULE", - "raw_max": "100", - "si_max": "100", - "units": "J", - "units_description": "Joules", - "value0": "Energy (0 to 100)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Power", - "id": "5", - "name": "ES-IN-WATT", - "raw_max": "10000", - "si_max": "10000", - "units": "W", - "units_description": "Watts", - "value0": "Power (0 to 10000)" - }, - { - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Power", - "id": "6", - "name": "ES-OUT-WATT", - "raw_max": "10000", - "si_max": "10000", - "units": "W", - "units_description": "Watts", - "value0": "Power (0 to 10000)" - }, - { - "data_sets": "7", - "data_type": "MSENSOR_DATA_S16_BE", - "decimals": "3", - "description": "All", - "id": "7", - "name": "ES-ALL", - "raw_max": "10000", - "si_max": "10000", - "value0": "Input Voltage (0 to 10000)", - "value1": "Input Current (0 to 10000)", - "value2": "Output Voltage (0 to 10000)", - "value3": "Output Current (0 to 10000)", - "value4": "Energy (0 to 100)", - "value5": "Input Power (0 to 10000)", - "value6": "Output Power (0 to 10000)" - } - ], - "name": "lego-power-storage", - "num_modes": "8", - "product_id": "", - "sensor_type": "nxt-i2c-sensor", - "url_name": "lego-energy-display", - "vendor_id": "LEGO", - "vendor_name": "LEGO", - "vendor_part_name": "Energy Display", - "vendor_part_number": "9668", - "vendor_website": "http://education.lego.com/en-us/lego-education-product-database/machines-and-mechanisms/9668-energy-display" - }, - { - "default_address": "0x4C", - "default_address_footnote": "[^addresses]", - "device_class": "[hwmon](http://www.lm-sensors.org/) [^usage]", - "id": "LEGO_NXT_TEMPERATURE_SENSOR", - "name": "tmp275", - "notes": "\n[^addresses]: Valid addresses are 0x48..0x4F (configurable via input pins)\n \n[^usage]: Sample usage:\n \n Register I2C device:\n \n
echo tmp275 0x4C > /sys/bus/i2c/devices/i2c-/new_device\n    
\n \n Finding device class node:\n \n
for chip in $(find /sys/class/hwmon -name hwmon*)\n    do\n        if [[ \"$(cat $chip/device/name)\" == \"tmp275\" ]]\n        then\n            # do whatever\n        fi\n    done\n    
\n \n ", - "sensor_type": "lm75", - "url_name": "lego-nxt-temperature-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "NXT Temperature Sensor", - "vendor_part_number": "9749", - "vendor_website": "http://education.lego.com/en-us/lego-education-product-database/mindstorms/9749-nxt-temperature-sensor/" - }, - { - "analog_mode_info": [ - { - "analog_cb": "nxt_touch_sensor_cb", - "id": "0" - } - ], - "id": "LEGO_NXT_TOUCH_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "description": "Button state", - "id": "0", - "name": "TOUCH", - "notes": "\n[^mode0-value]: Values:\n \n | Value | Description |\n |:-----:|:-----------:|\n | `0` | Released |\n | `1` | Pressed |\n \n ", - "pct_max": "100", - "raw_max": "1", - "si_max": "1", - "value0": "State (0 or 1)", - "value0_footnote": "[^mode0-value]" - } - ], - "name": "lego-nxt-touch", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "url_name": "lego-nxt-touch-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "NXT Touch Sensor", - "vendor_part_number": "9843", - "vendor_website": "http://www.lego.com/en-us/mindstorms/downloads/software/nxt-hdk/" - }, - { - "analog_mode_info": [ - { - "id": "0", - "pin5_state": "EV3_INPUT_PORT_GPIO_HIGH" - }, - { - "id": "1", - "pin5_state": "EV3_INPUT_PORT_GPIO_LOW" - } - ], - "id": "LEGO_NXT_LIGHT_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "1", - "description": "Reflected light
LED on", - "id": "0", - "name": "NXT-REFLECT", - "pct_max": "100", - "raw_max": "543", - "raw_min": "4116", - "si_max": "1000", - "units": "pct", - "units_description": "percent", - "value0": "Reflected light intensity (0 to 100)" - }, - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "1", - "description": "Ambient light
LED off", - "id": "1", - "name": "NXT-AMBIENT", - "pct_max": "100", - "raw_max": "773", - "raw_min": "4164", - "si_max": "1000", - "units": "pct", - "units_description": "percent", - "value0": "Ambient light intensity (0 to 100)" - } - ], - "name": "lego-nxt-light", - "num_modes": "2", - "sensor_type": "nxt-analog-sensor", - "url_name": "lego-nxt-light-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "NXT Light Sensor", - "vendor_part_number": "9844", - "vendor_website": "http://www.lego.com/en-us/mindstorms/downloads/software/nxt-hdk/" - }, - { - "analog_mode_info": [ - { - "id": "0", - "pin5_state": "EV3_INPUT_PORT_GPIO_LOW" - }, - { - "id": "1", - "pin5_state": "EV3_INPUT_PORT_GPIO_HIGH" - } - ], - "id": "LEGO_NXT_SOUND_SENSOR", - "ms_mode_info": [ - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "1", - "description": "Sound pressure level
Flat weighting", - "id": "0", - "name": "NXT-SND-DB", - "pct_max": "100", - "raw_max": "5000", - "si_max": "1000", - "units": "pct", - "units_description": "percent", - "value0": "Sound pressure level (0 to 1000)" - }, - { - "data_sets": "1", - "data_type": "MSENSOR_DATA_S32", - "decimals": "1", - "description": "Sound pressure level
A weighting", - "id": "1", - "name": "NXT-SND_DBA", - "pct_max": "100", - "raw_max": "5000", - "si_max": "1000", - "units": "pct", - "units_description": "percent", - "value0": "Sound pressure level (0 to 1000)" - } - ], - "name": "lego-nxt-sound", - "num_modes": "2", - "sensor_type": "nxt-analog-sensor", - "url_name": "lego-nxt-sound-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "NXT Sound Sensor", - "vendor_part_number": "9845", - "vendor_website": "http://www.lego.com/en-us/mindstorms/downloads/software/nxt-hdk/" - }, - { - "default_address": "0x01", - "i2c_mode_info": [ - { - "id": "0", - "pin1_state": "EV3_INPUT_PORT_GPIO_HIGH", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "1", - "pin1_state": "EV3_INPUT_PORT_GPIO_HIGH", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "2", - "pin1_state": "EV3_INPUT_PORT_GPIO_HIGH", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "3", - "pin1_state": "EV3_INPUT_PORT_GPIO_HIGH", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "4", - "pin1_state": "EV3_INPUT_PORT_GPIO_HIGH", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - } - ], - "id": "LEGO_NXT_ULTRASONIC_SENSOR", - "ms_mode_info": [ - { - "description": "Continuous measurement", - "id": "0", - "name": "NXT-US-CM", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0 to 255)" - }, - { - "decimals": "1", - "description": "Continuous measurement", - "id": "1", - "name": "NXT-US-IN", - "si_max": "1000", - "units": "in", - "units_description": "inches", - "value0": "Distance (0 to 1000)" - }, - { - "description": "Single measurement", - "id": "2", - "name": "NXT-US-SI-CM", - "notes": "\n[^single-measurement]: The value is read when the mode is set\n and does not change - even when polling is enabled. To read a\n new value, set the mode again (e.g. `echo NXT-US-SI-CM > mode`).\n \n ", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0 to 255)", - "value0_footnote": "[^single-measurement]" - }, - { - "decimals": "1", - "description": "Single measurement", - "id": "3", - "name": "NXT-US-SI-IN", - "si_max": "1000", - "units": "in", - "units_description": "inches", - "value0": "Distance (0 to 1000)", - "value0_footnote": "[^single-measurement]" - }, - { - "description": "Listen", - "id": "4", - "name": "NXT-US-LIST", - "notes": "\n[^listen-value]: A value of `1` indicates that another ultrasonic\n sensor has been detected. A `1` can also be triggered by a loud\n noise such as clapping.\n \n ", - "raw_max": "1", - "si_max": "1", - "value0": "Presence (0 or 1)", - "value0_footnote": "[^listen-value]" - } - ], - "name": "lego-nxt-ultrasonic", - "num_modes": "5", - "num_read_only_modes": "2", - "product_id": "Sonar", - "sensor_type": "nxt-i2c-sensor", - "slow": "true", - "url_name": "lego-nxt-ultrasonicsensor", - "vendor_id": "LEGO", - "vendor_name": "LEGO", - "vendor_part_name": "NXT Ultrasonic Sensor", - "vendor_part_number": "9846", - "vendor_website": "http://www.lego.com/en-us/mindstorms/downloads/software/nxt-hdk/" - }, - { - "default_address": "0x0A", - "default_address_footnote": "[^address]", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0", - "set_mode_data": "'W'", - "set_mode_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0", - "set_mode_data": "'B'", - "set_mode_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0", - "set_mode_data": "'A'", - "set_mode_reg": "0" - }, - { - "id": "5", - "read_data_reg": "0", - "set_mode_data": "'E'", - "set_mode_reg": "0" - }, - { - "id": "6", - "read_data_reg": "0", - "set_mode_data": "'U'", - "set_mode_reg": "0" - } - ], - "id": "MS_LIGHT_SENSOR_ARRAY", - "ms_mode_info": [ - { - "data_sets": "8", - "description": "Calibrated values", - "id": "0", - "name": "MS-LSA-CAL", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - }, - { - "data_sets": "8", - "data_type": "MSENSOR_DATA_S16", - "description": "Raw values", - "id": "1", - "name": "MS-LSA-RAW", - "raw_max": "USHRT_MAX", - "si_max": "USHRT_MAX", - "value0": "LED 0 (0 to ???)", - "value1": "LED 1 (0 to ???)", - "value2": "LED 2 (0 to ???)", - "value3": "LED 3 (0 to ???)", - "value4": "LED 4 (0 to ???)", - "value5": "LED 5 (0 to ???)", - "value6": "LED 6 (0 to ???)", - "value7": "LED 7 (0 to ???)" - }, - { - "data_sets": "8", - "description": "Calibrate to white", - "id": "2", - "name": "MS-LSA-C-W", - "name_footnote": "[^config-modes]", - "notes": "\n[^config-modes]: This mode returns the same values as `MS-LSA-CAL`\n \n ", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - }, - { - "data_sets": "8", - "description": "Calibrate to black", - "id": "3", - "name": "MS-LSA-C-B", - "name_footnote": "[^config-modes]", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - }, - { - "data_sets": "8", - "description": "Configure for 60Hz electrical mains", - "id": "4", - "name": "MS-LSA-C-A", - "name_footnote": "[^config-modes]", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - }, - { - "data_sets": "8", - "description": "Configure for 50Hz electrical mains", - "id": "5", - "name": "MS-LSA-C-E", - "name_footnote": "[^config-modes]", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - }, - { - "data_sets": "8", - "description": "Configure for universal electrical mains", - "id": "6", - "name": "MS-LSA-C-U", - "name_footnote": "[^config-modes]", - "raw_max": "100", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "LED 0 (0 to 100)", - "value1": "LED 1 (0 to 100)", - "value2": "LED 2 (0 to 100)", - "value3": "LED 3 (0 to 100)", - "value4": "LED 4 (0 to 100)", - "value5": "LED 5 (0 to 100)", - "value6": "LED 6 (0 to 100)", - "value7": "LED 7 (0 to 100)" - } - ], - "name": "ms-light-array", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n ", - "num_modes": "7", - "num_read_only_modes": "2", - "product_id": "LSArray", - "sensor_type": "nxt-i2c-sensor", - "url_name": "mindsensors.com-light-sensor-array", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Light Sensor Array", - "vendor_part_number": "LightSensorArray", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=168" - }, - { - "default_address": "0x58", - "default_address_footnote": "[^address]", - "device_class_footnote": "[^servo-motor-devices]", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "MS_8CH_SERVO", - "ms_mode_info": [ - { - "decimals": "3", - "description": "EV3 Compatible", - "id": "0", - "name": "MS-8CH-SERVO-V3", - "notes": "\n \n[^battery-voltage]: The current voltage scaling is based on\n the manufacturers documentation, however it seems to be low.\n If you are seeing this too, please open an issue on GitHub\n and we will change the scaling.\n \n ", - "raw_max": "255", - "raw_min": "127", - "si_max": "9400", - "si_min": "4700", - "units": "V", - "units_description": "volts", - "value0": "Battery voltage (0 to 9400)", - "value0_footnote": "[^battery-voltage]" - }, - { - "decimals": "3", - "description": "Older versions", - "id": "1", - "name": "MS-8CH-SERVO", - "name_footnote": "[^old-mode]", - "notes": "\n[^old-mode]: Older versions of this sensor have the battery\n voltage at a different address. If the default mode does not\n return a value, try this mode.\n \n ", - "raw_max": "255", - "raw_min": "127", - "si_max": "9400", - "si_min": "4700", - "units": "V", - "units_description": "volts", - "value0": "Battery voltage (0 to 9400)", - "value0_footnote": "[^battery-voltage]" - } - ], - "name": "ms-8ch-servo", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n[^servo-motor-devices]: The `ms-8ch-servo` driver loads separate\n servo motor devices (one for each of the 8 channels) in addition\n to the [msensor] device. See the [Servo Motor Class](../servo-motor-class)\n for more information. The `servo_motor` class `port_name` attribute\n will return `in:sv` where `` is the input port the servo\n controller is connected to and `` is the channel as indicated\n on the servo controller itself.\n \n ", - "num_modes": "2", - "ops.probe_cb": "ms_8ch_servo_probe_cb", - "ops.remove_cb": "ms_8ch_servo_remove_cb", - "product_id": "NXTServo", - "sensor_type": "nxt-i2c-sensor", - "url_name": "mindsensors.com-8-channel-servo-controller", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "8-channel Servo Controller", - "vendor_part_number": "NxtServo", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=93" - }, - { - "default_address": "0x38", - "default_address_footnote": "[^addresses]", - "device_class": "[gpio](https://www.kernel.org/doc/Documentation/gpio/) [^usage]", - "id": "MS_SENSOR_KIT_PFC8574", - "name": "pcf8574", - "notes": "\n[^addresses]: Valid addresses are 0x38..0x3F (configurable via input pins)\n \n[^usage]: Sample usage:\n \n Register I2C device:\n \n
echo pcf8574 0x38 > /sys/bus/i2c/devices/i2c-/new_device\n    
\n \n Finding device class node and initializing:\n \n
for chip in $(find /sys/class/gpio -name gpiochip*)\n    do\n        if [[ \"$(cat $chip/label)\" == \"pcf8547\" ]]\n        then\n            base=$(cat $chip/export/base)\n            # Pins are active low\n            for i in {0..7}\n            do\n                gpio=$(($base + $gpio))\n                echo $gpio > /sys/class/gpio/export\n                # gpios on this chip are active low\n                echo 1 > /sys/class/gpio/gpio$gpio/active_low\n                # initialize direction here\n            done\n            # do whatever with the gpios\n        fi\n    done\n    
\n \n ", - "sensor_type": "gpio-pcf857xr", - "url_name": "mindsensors.com-sensor-building-kit-for-nxt-with-pcf8574-ic", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Sensor building kit for NXT with PCF8574 IC", - "vendor_part_number": "PCF8574-Nx", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=71" - }, - { - "default_address": "0x48", - "default_address_footnote": "[^addresses]", - "device_class": "[hwmon](http://www.lm-sensors.org/) [^usage]", - "id": "MS_SENSOR_KIT_PCF8591", - "name": "pcf8591", - "notes": "\n[^addresses]: Valid addresses are 0x48..0x4F (configurable via input pins)\n \n[^usage]: Sample usage:\n \n Register I2C device:\n \n
echo pcf8591 0x48 > /sys/bus/i2c/devices/i2c-/new_device\n    
\n \n Finding device class node:\n \n
for chip in $(find /sys/class/hwmon -name hwmon*)\n    do\n        if [[ \"$(cat $chip/device/name)\" == \"pcf8591\" ]]\n        then\n            # do whatever\n        fi\n    done\n    
\n \n ", - "sensor_type": "pcf8591", - "url_name": "mindsensors.com-sensor-building-kit-for-nxt-with-pcf8591-ic", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Sensor building kit for NXT with PCF8591 IC", - "vendor_part_number": "PCF8591-Nx", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=92" - }, - { - "default_address": "0x68", - "device_class": "[rtc](https://www.kernel.org/doc/Documentation/rtc.txt) [^usage]", - "id": "MS_RTC", - "name": "ds1307", - "notes": "\n[^usage]: Sample usage:\n \n Register I2C device:\n \n
echo ds1307 0x68 > /sys/bus/i2c/devices/i2c-/new_device\n    
\n \n Finding device class node:\n \n
for chip in $(find /sys/class/rtc -name rtc*)\n    do\n        if [[ \"$(cat $chip/name)\" == \"ds1307\" ]]\n        then\n            # do whatever\n        fi\n    done\n    
\n \n ", - "sensor_type": "rtc-ds1307", - "url_name": "mindsensors.com-realtime-clock-for-nxt", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Realtime Clock for NXT", - "vendor_part_number": "RTC-Nx-v3", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=77" - }, - { - "analog_mode_info": [ - { - "analog_cb": "ms_touch_mux_cb", - "id": "0" - } - ], - "id": "MS_TOUCH_SENSOR_MUX", - "ms_mode_info": [ - { - "data_sets": "3", - "description": "Touch sensors", - "id": "0", - "name": "TOUCH-MUX", - "notes": "\n[^values]: Values:\n \n | Value | Description |\n |:-----:|:-----------:|\n | `0` | Released |\n | `1` | Pressed |\n \n ", - "pct_max": "100", - "raw_max": "1", - "si_max": "1", - "value0": "Sensor T1 state", - "value0_footnote": "[^values]", - "value1": "Sensor T2 state", - "value1_footnote": "[^values]", - "value2": "Sensor T3 state", - "value2_footnote": "[^values]" - } - ], - "name": "ms-nxt-touch-mux", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "url_name": "mindsensors.com-touch-sensor-multiplexer-for-nxt-ev3", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Touch Sensor Multiplexer for NXT & EV3", - "vendor_part_number": "TouchMux", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=135" - } -] diff --git a/_data/tutorial-groups.yml b/_data/tutorial-groups.yml new file mode 100644 index 000000000..07ba55388 --- /dev/null +++ b/_data/tutorial-groups.yml @@ -0,0 +1,39 @@ +- title: "Software" + id: "software" + items: + - id: basic-networking + title: Basic Networking + description: "Connecting ev3dev to a local network or the internet, and connecting to an ev3dev device from a PC." + - id: advanced-networking + title: Advanced Networking + description: "Communicating using special protocols between multiple devices on a network." + - id: software-languages + title: Programming Languages and Tooling + description: "Configuring a development environment, installing new languages, and using advanced language tools." + - id: software-editors + title: "Text Editors" + description: "Tips on using text editors which ship with ev3dev out-of-the-box." + - id: cross-compiling + title: Cross-Compiling Code + description: "Compiling code to run on an EV3 or other ev3dev device from a host PC." +- title: "Hardware" + id: "hardware" + items: + - id: hardware-standard + title: "Standard Hardware" + description: "Configuring and using motors, sensors, buttons and other standard functionality on ev3dev." + - id: hardware-extras + title: Extra Hardware + description: "Configuration and usage of specialty and otherwise nonstandard hardware." +- title: "System administration & setup" + id: "administration-and-setup" + items: + - id: sd-card-image + title: SD Card Imaging + description: "Guides on flashing an SD card with ev3dev images." + - id: system + title: "Ev3dev System" + description: "Configuring, updating and modifying an ev3dev installation." + - id: website + title: This Website + description: "Using this website and contributing content." \ No newline at end of file diff --git a/_includes/author-card.html b/_includes/author-card.html deleted file mode 100644 index 7587f8144..000000000 --- a/_includes/author-card.html +++ /dev/null @@ -1,16 +0,0 @@ - - -{% assign authors = author_card %} -{% for author in authors %} - {% assign author_no_at_sign = author | strip_html | remove_first: "@" %} - {% assign at_sign = author | strip_html | replace: author_no_at_sign %} - - {% assign test_at_sign_is_first = author | truncate: 4 | replace: "@" | size %} - - {% if at_sign.size > 0 and test_at_sign_is_first == 3 %} -

- {% else %} -
{{ author }}
- {% endif %} -{% endfor %} diff --git a/_includes/docs/imaging-tutorial-etcher-banner.html b/_includes/docs/imaging-tutorial-etcher-banner.html new file mode 100644 index 000000000..a109ba1c1 --- /dev/null +++ b/_includes/docs/imaging-tutorial-etcher-banner.html @@ -0,0 +1,5 @@ +{% include /style/icon.html type="info" %} +There's an easier way to image your SD card! Check out +[the "Getting Started" guide](/docs/getting-started#step-2-flash-the-sd-card){: .alert-link } +for a cross-platform guide. +{: .alert .alert-info} diff --git a/_includes/footer.html b/_includes/footer.html deleted file mode 100644 index 8e1b1b2a4..000000000 --- a/_includes/footer.html +++ /dev/null @@ -1,11 +0,0 @@ - - diff --git a/_includes/head.html b/_includes/head.html deleted file mode 100644 index 9dcbafa80..000000000 --- a/_includes/head.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - {{ page.title }} - - - - - - - - - - - diff --git a/_includes/header.html b/_includes/header.html deleted file mode 100644 index 1637510a1..000000000 --- a/_includes/header.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - diff --git a/_includes/page-core/breadcrumbs.html b/_includes/page-core/breadcrumbs.html new file mode 100644 index 000000000..215312af7 --- /dev/null +++ b/_includes/page-core/breadcrumbs.html @@ -0,0 +1,33 @@ +{% assign parent_dirs=page.url | replace_first: '/', '' | split: '/' %} +{% assign link='/' %} + \ No newline at end of file diff --git a/_includes/page-core/deferred-head-resources.html b/_includes/page-core/deferred-head-resources.html new file mode 100644 index 000000000..7a5e540d2 --- /dev/null +++ b/_includes/page-core/deferred-head-resources.html @@ -0,0 +1,41 @@ +{% if page.enable_x3d_support %} + + + + +{% endif %} + + + + + + + + + + + + + + + + + + + +{% if page.include_masonry %} + +{% endif %} + + + + + + + + + + + + + \ No newline at end of file diff --git a/_includes/page-core/html-head.html b/_includes/page-core/html-head.html new file mode 100644 index 000000000..3266d748c --- /dev/null +++ b/_includes/page-core/html-head.html @@ -0,0 +1,51 @@ + + + + + + {{ page.title | xml_escape }} + {% if page.excerpt %} + + {% else %} + + {% endif %} + + + + + + + + + + + + + + + {% if page.extra-head-content %} + {{ page.extra-head-content }} + {% endif %} + + {% if site.github.owner_name == "ev3dev" %} + + {% else %} + + {% endif %} + diff --git a/_includes/page-core/page-footer.html b/_includes/page-core/page-footer.html new file mode 100644 index 000000000..f88b42594 --- /dev/null +++ b/_includes/page-core/page-footer.html @@ -0,0 +1,27 @@ + diff --git a/_includes/page-core/page-header.html b/_includes/page-core/page-header.html new file mode 100644 index 000000000..4e0749e34 --- /dev/null +++ b/_includes/page-core/page-header.html @@ -0,0 +1,124 @@ + diff --git a/_includes/page-core/title.html b/_includes/page-core/title.html new file mode 100644 index 000000000..e069bac72 --- /dev/null +++ b/_includes/page-core/title.html @@ -0,0 +1,28 @@ +{% if page.source_file %} + {% assign edit_path = page.source_file | replace: 'drivers/lego', 'https://github.com/ev3dev/lego-linux-drivers/edit/master' %} + {% if page.source_line > 0 %} + {% assign source_line = page.source_line | plus: 0 %} + {% assign edit_path = edit_path | append: '#L' | append: source_line %} + {% endif %} +{% elsif page.path contains 'docs/' %} + {% if site.github.repository_url %} + {% assign repo_url = site.github.repository_url %} + {% else %} + {% assign repo_url = 'https://github.com/ev3dev/ev3dev.github.io' %} + {% endif %} + {% assign edit_path = repo_url | append: '/edit/master/' | append: page.path %} +{% elsif page.path contains 'news/' %} + {% assign show_news_link = 1 %} +{% endif %} + + \ No newline at end of file diff --git a/_includes/screenshot.html b/_includes/screenshot.html deleted file mode 100644 index 703b5cf91..000000000 --- a/_includes/screenshot.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/_includes/sensor-connection.html b/_includes/sensor-connection.html deleted file mode 100644 index 8f974ab3b..000000000 --- a/_includes/sensor-connection.html +++ /dev/null @@ -1,27 +0,0 @@ -{% case sensor.sensor_type %} -{% when 'nxt-analog-sensor' %} - {% assign connection = "Analog/NXT" %} - {% if sensor.name == 'lego-nxt-touch' or sensor.name == 'lego-nxt-light' or sensor.name == 'nxt-analog' %} - {% assign autodetect = "Y" %} - {% else %} - {% assign autodetect = "N[^nxt-analog]" %} - {% endif %} -{% when 'ev3-analog-sensor' %} - {% assign connection = "Analog/EV3" %} - {% assign autodetect = "Y" %} -{% when 'nxt-i2c-sensor' %} - {% assign connection = "I2C/NXT" %} - {% assign autodetect = "Y" %} -{% when 'gpio-pcf857xr' or 'pcf8591' or 'rtc-ds1307' %} - {% assign connection = "I2C/Other" %} - {% assign autodetect = "N[^standard-i2c]" %} -{% when 'lm75' %} - {% assign connection = "I2C/Other" %} - {% assign autodetect = "Y[^lm75]" %} -{% when 'legoev3-uart' %} - {% assign connection = "UART/EV3" %} - {% assign autodetect = "Y" %} -{% else %} - {% assign connection = "" %} - {% assign autodetect = "" %} -{% endcase %} \ No newline at end of file diff --git a/_includes/sensor.md b/_includes/sensor.md deleted file mode 100644 index 7d7678373..000000000 --- a/_includes/sensor.md +++ /dev/null @@ -1,169 +0,0 @@ -{% assign sensor=site.data.sensors[page.sensor_index] %} -{% include sensor-connection.html %} -{% assign footnotes='' %} -{% if sensor.notes %} - {% assign footnotes=footnotes | append: sensor.notes %} -{% endif %} - - - -### General Info - - - - - - - {%if sensor.vendor_website %} - - - {% assign split_website=sensor.vendor_website | split: '/' %} - - - {% endif %} - - - - - {% if sensor.default_address %} - - - - - {% endif %} - - - - - {% if sensor.vendor_id %} - - - - - {% endif %} - {% if sensor.product_id %} - - - - - {% endif %} - {%if sensor.device_class == null %} - - - - - {% endif %} -
name{{ sensor.name }}
Website[{{ split_website[2] }}]({{ sensor.vendor_website }})
Connection{{ connection }}
Address - {{ sensor.default_address }}{{ sensor.default_address_footnote }} -
sysfs class - {%if sensor.device_class %} - {{ sensor.device_class }}{{ sensor.device_class_footnote }} -
vendor_id{{ sensor.vendor_id }}
product_id{{ sensor.product_id }}
# Modes{{ sensor.num_modes }}
- -{%if sensor.device_class == null %} -### Modes - - - - - - - - - - - {% for mode in sensor.ms_mode_info %} - {% if mode.notes %} - {% assign footnotes=footnotes | append: mode.notes %} - {% endif %} - - - - - - - - - {% endfor %} -
modeDescriptionunitsdp[^dp]num_valuesValues
- {{ mode.name }}{{ mode.name_footnote }},[^not-read-only] - {{ mode.description }} - {% if mode.units %} - {{ mode.units }} - {% if mode.units_description %} - ({{ mode.units_description }}) - {% endif %} - {% else %} - none - {% endif %} - - - {% if mode.decimals %} - {{ mode.decimals }} - {% else %} - 0 - {% endif %} - - - - {% assign num_modes=1 %} - {% if mode.data_sets %} - {% assign num_modes=mode.data_sets %} - {% endif %} - {{ num_modes }} - - - {% for i in (1..num_modes) %} - {% if i > 1 %} -
- {% endif %} - {% assign value=forloop.index0 | prepend: 'value' %} - {% assign value_footnote=value | append: '_footnote' %} - - {{ value }}: {{ mode[value] }}{{ mode[value_footnote] }} - - {% endfor %} -
- -Values in the tables that look like `this` are the names of sysfs attributes -or values returned by said attributes. - -[^dp]: Decimal places. For example, if the range of a value is from 0 to 1000 - and `dp` is `1`, then the acutal range is 0.0 to 100.0 in the units specified. - -[^not-read-only]: This mode is not availible when the sensor is connected to a - read-only input port like the HiTechnic NXT Sensor MUX. -{% endif %} - -{{ footnotes }} - -[msensor]: ../../drivers/msensor-class \ No newline at end of file diff --git a/_includes/style/begin-panel.html b/_includes/style/begin-panel.html new file mode 100644 index 000000000..66da8470e --- /dev/null +++ b/_includes/style/begin-panel.html @@ -0,0 +1,17 @@ +{% comment %} + +Used to begin a bootstrap panel. + +Parameters: + + type: Can be one of "success", "info", "warning" or "danger". + heading: The heading text. + +{% endcomment %} +
+
+{% include /style/icon.html %}{% comment %} +Note: the `type` parameter is implicitly passed through to icon.html.{% endcomment %} +{{ include.heading }} +
+
diff --git a/_includes/style/begin-section.html b/_includes/style/begin-section.html new file mode 100644 index 000000000..cfbaa6c43 --- /dev/null +++ b/_includes/style/begin-section.html @@ -0,0 +1,11 @@ +{% comment %} + +Used to begin a visually separated section. + +Parameters: + + bg: Sets the background to light or dark. (optional) + +{% endcomment %} +
+
diff --git a/_includes/style/end-panel.html b/_includes/style/end-panel.html new file mode 100644 index 000000000..259abbdfb --- /dev/null +++ b/_includes/style/end-panel.html @@ -0,0 +1,7 @@ +{% comment %} + +Used to end a panel started with {% include /style/begin-panel.html %} + +{% endcomment %} +
+
diff --git a/_includes/style/end-section.html b/_includes/style/end-section.html new file mode 100644 index 000000000..d5399a11b --- /dev/null +++ b/_includes/style/end-section.html @@ -0,0 +1,7 @@ +{% comment %} + +Used to end a section started with {% include /style/begin-section.html %} + +{% endcomment %} +
+
diff --git a/_includes/style/icon.html b/_includes/style/icon.html new file mode 100644 index 000000000..2b8293501 --- /dev/null +++ b/_includes/style/icon.html @@ -0,0 +1,10 @@ +{% comment %} + +This template provides icons to match bootstrap alerts. + +Parameters: + +type: A name that matches an alert. Valid values are "success", info", "warning" and "danger". +class: A string to be used for additional "class" values (optional) + +{% endcomment %}{% assign name = include.type %}{% if name == "success" %}{% assign name = "ok" %}{% elsif name == "info" %}{% assign name = "info-sign" %}{% elsif name == "warning" %}{% assign name = "alert" %}{% elsif name == "danger" %}{% assign name = "exclamation-sign" %}{% endif %} \ No newline at end of file diff --git a/_includes/style/language-logo.html b/_includes/style/language-logo.html new file mode 100644 index 000000000..0e426081d --- /dev/null +++ b/_includes/style/language-logo.html @@ -0,0 +1,17 @@ +{% assign sanitized_str = include.language | downcase %} + +{% if site.data.langs.js-opts contains sanitized_str %} + {% assign language_icon = 'nodejs' %} + {% assign language_link = 'https://nodejs.org/' %} +{% elsif site.data.langs.python-opts contains sanitized_str %} + {% assign language_icon = 'python' %} + {% assign language_link = 'https://www.python.org/' %} +{% endif %} + +{% if language_icon %} + + {{ include.language }} + +{% else %} + {{ include.language }} +{% endif %} \ No newline at end of file diff --git a/_includes/title.html b/_includes/title.html deleted file mode 100644 index 0f1d87cc1..000000000 --- a/_includes/title.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
- - - -
-

{{ page.title }}

-

{{ page.subtitle }}

-
-
-
-
- diff --git a/_includes/util/author-card.html b/_includes/util/author-card.html new file mode 100644 index 000000000..7d5345ad5 --- /dev/null +++ b/_includes/util/author-card.html @@ -0,0 +1,16 @@ + + +{% assign author_no_at_sign = include.author | strip_html | remove_first: "@" %} +{% assign at_sign = include.author | strip_html | replace: author_no_at_sign %} +{% if include.theme %} +{% assign extra_classes = "user-card-" | append: include.theme %} +{% endif %} + +{% assign test_at_sign_is_first = include.author | truncate: 4 | replace: "@" | size %} + +{% if at_sign.size > 0 and test_at_sign_is_first == 3 %} +
{{ include.author }}

+{% else %} +
{{ include.author }}
+{% endif %} \ No newline at end of file diff --git a/_includes/author-mention.html b/_includes/util/author-mention.html similarity index 100% rename from _includes/author-mention.html rename to _includes/util/author-mention.html diff --git a/_includes/util/screenshot.html b/_includes/util/screenshot.html new file mode 100644 index 000000000..4370ae290 --- /dev/null +++ b/_includes/util/screenshot.html @@ -0,0 +1,12 @@ +{% comment %} + +Used to format a screenshot. + +Parameters: + +source: The url of the image +caption: (optional) A caption that is displayed under the image. +width: (optional) The width property of the image, including units. +float: (optional) whether to float the image to the right or not. Default is false. + +{% endcomment %}{% if include.caption %}{{ include.caption }}{% else %}screenshot{% endif %}{% if include.caption %}{{ include.caption }}{% endif %} \ No newline at end of file diff --git a/_includes/util/x3d-model.html b/_includes/util/x3d-model.html new file mode 100644 index 000000000..015322a34 --- /dev/null +++ b/_includes/util/x3d-model.html @@ -0,0 +1,21 @@ +{% comment %} + +Used to format x3d model + +Prerequisities: +Your YAML front matter needs the line: +enable_x3d_support: true + +If this is set to true we add javascript and css for x3dom to the header + +See: +https://jekyllrb.com/docs/frontmatter/ + +Parameters: + +source: The url of the x3d model +caption: (optional) A caption that is displayed under the model. + +{% endcomment %} + {% if page.enable_x3d_support %} {% if include.caption %}
{{ include.caption }} {% endif %} {% else %} X3D support was not enabled. Add enable_x3d_support: true to your YAML front matter https://jekyllrb.com/docs/frontmatter/ {% endif %}
+ diff --git a/_includes/util/youtube-embed.html b/_includes/util/youtube-embed.html new file mode 100644 index 000000000..dd802eb23 --- /dev/null +++ b/_includes/util/youtube-embed.html @@ -0,0 +1,13 @@ +{% if page.youtube_video_id %} + {% assign video_id = page.youtube_video_id %} +{% elsif include.youtube_video_id %} + {% assign video_id = include.youtube_video_id %} +{% endif %} + +{% if video_id %} +
+ + +
+

+{% endif %} \ No newline at end of file diff --git a/_includes/youtube-embed.html b/_includes/youtube-embed.html deleted file mode 100644 index e40771e46..000000000 --- a/_includes/youtube-embed.html +++ /dev/null @@ -1,4 +0,0 @@ -{% if page.youtube_video_id %} - -

-{% endif %} \ No newline at end of file diff --git a/_layouts/docs.html b/_layouts/docs.html index 83469c11a..9fcd12888 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -2,21 +2,26 @@ layout: page --- - -