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 f6eeb8741..886f02376 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,52 @@ -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 +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: @@ -30,28 +54,16 @@ Then run: 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 deae3ee45..8ad378c34 100644 --- a/_config.yml +++ b/_config.yml @@ -1,8 +1,17 @@ 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 @@ -15,30 +24,13 @@ defaults: values: layout: "docs" categories: "docs" - - - scope: - path: "docs/drivers" - type: "pages" - values: - category: "drivers" - scope: path: "docs/tutorials" type: "pages" values: category: "tutorials" - - - scope: - path: "docs/sensors" - type: "pages" - values: - category: "sensors" - - - scope: - path: "docs/motors" - type: "pages" - values: - category: "motors" + layout: "tutorial" - scope: path: "docs/devtools" @@ -57,12 +49,15 @@ defaults: type: "posts" values: layout: "project" + 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 7b0eb518f..000000000 --- a/_data/motors.json +++ /dev/null @@ -1,169 +0,0 @@ -[ - { - "name": "fi-l12-ev3", - "device_type": "legoev3-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": "fi-l12-ev3", - "device_type": "legoev3-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": "lego-ev3-l-motor", - "device_type": "legoev3-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": "lego-ev3-l-motor", - "device_type": "legoev3-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": "lego-ev3-m-motor", - "device_type": "legoev3-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/ports.json b/_data/ports.json deleted file mode 100644 index a88dc8bf7..000000000 --- a/_data/ports.json +++ /dev/null @@ -1,262 +0,0 @@ -[ - { - "connection_types": "NXT/Analog, NXT/I2C, EV3/Analog, EV3/UART", - "description": "Dexter Industries BrickPi Input Port", - "mode_info": [ - { - "description": "No sensor", - "id": "BRICKPI_IN_PORT_MODE_NONE", - "name": "none" - }, - { - "description": "NXT/Analog sensor", - "id": "BRICKPI_IN_PORT_MODE_NXT_ANALOG", - "name": "nxt-analog", - "name_footnote": "[^nxt-analog-mode]", - "notes": "\n[^nxt-analog-mode]: The [nxt-analog] driver will be loaded when\n this mode is set. You must manually specify the correct\n driver for your sensor using `set_device` if you want to use\n another driver. Any driver with a connection type of\n NXT/Analog is allowed.\n ^\n [nxt-analog]: /docs/sensors/generic-nxt-analog-sensor\n \n " - }, - { - "description": "LEGO NXT Color sensor", - "id": "BRICKPI_IN_PORT_MODE_NXT_COLOR", - "name": "nxt-color" - }, - { - "description": "NXT/I2C sensor", - "id": "BRICKPI_IN_PORT_MODE_NXT_I2C", - "name": "nxt-i2c", - "name_footnote": "[^nxt-i2c-mode]", - "notes": "\n[^nxt-i2c-mode]: No sensors are loaded by default. You must\n manually specify the sensor that is connected by using the\n `set_device` attribute.\n \n " - }, - { - "description": "EV3/Analog sensor", - "id": "BRICKPI_IN_PORT_MODE_EV3_ANALOG", - "name": "ev3-analog", - "name_footnote": "[^ev3-analog-mode]", - "notes": "\n[^ev3-analog-mode]: Only the LEGO EV3 Touch sensor is supported.\n The driver will load by default.\n \n " - }, - { - "description": "EV3/UART sensor", - "id": "BRICKPI_IN_PORT_MODE_EV3_UART", - "name": "ev3-uart", - "name_footnote": "[^ev3-uart-mode]", - "notes": "\n[^ev3-uart-mode]: Only the LEGO EV3 Ultrasonic, Color, Gyro,\n and Infrared sensors are supported. They cannot be automatically\n detected, so you must specify the sensor manually using the\n `set_device` attribute. No sensors are loaded by default.\n \n " - } - ], - "module": "brickpi-ports-in", - "name": "brickpi-in-port", - "num_modes": 6, - "prefix": "in", - "source_file": "drivers/lego/brickpi/brickpi_ports_in.c", - "source_line": 56, - "url_name": "brickpi-in-port" - }, - { - "connection_types": "tacho-motor", - "description": "Dexter Industries BrickPi Input Port", - "mode_info": [ - { - "description": "NXT/EV3 Large Motor", - "id": "BRICKPI_OUT_PORT_MODE_NXT_MOTOR", - "name": "nxt-motor" - }, - { - "description": "RCX/Power Functions motor", - "id": "BRICKPI_OUT_PORT_MODE_RCX_MOTOR", - "name": "rcx-motor" - }, - { - "description": "RCX/Power Functions LED", - "id": "BRICKPI_OUT_PORT_MODE_RCX_LED", - "name": "rcx-led" - } - ], - "module": "brickpi-ports-out", - "name": "brickpi-out-port", - "num_modes": 3, - "prefix": "out", - "source_file": "drivers/lego/brickpi/brickpi_ports_out.c", - "source_line": 47, - "url_name": "brickpi-out-port" - }, - { - "connection_types": "NXT/I2C, NXT/Analog", - "description": "HiTechnic NXT Sensor Multiplexer Input Port", - "mode_info": [ - { - "description": "NXT/Analog sensor", - "id": "HT_NXT_SMUX_PORT_MODE_ANALOG", - "name": "analog", - "name_footnote": "[^analog-mode]", - "notes": "\n[^analog-mode]: The [nxt-analog] driver will be loaded when\n this mode is set. You must manually specify the correct\n driver for your sensor using `set_device` if you want to use\n another driver. Any driver with a connection type of\n NXT/Analog is allowed.\n ^\n [nxt-analog]: /docs/sensors/generic-nxt-analog-sensor\n \n " - }, - { - "description": "NXT/I2C sensor", - "id": "HT_NXT_SMUX_PORT_MODE_I2C", - "name": "i2c", - "name_footnote": "[^i2c-mode]", - "notes": "\n[^i2c-mode]: If one of the supported sensors was detected\n by invoking the `DETECT` command on the [ht-nxt-smux]\n associated with this port, then the appropriate driver will\n be automatically loaded. Otherwise, you can use `set_device`\n to load the correct driver for your sensor. Any driver with\n a connection type of NXT/I2C is allowed.\n ^\n [ht-nxt-smux]: /docs/sensors/hitechnic-nxt-sensor-multiplexer\n \n " - } - ], - "module": "ht-nxt-smux", - "name": "ht-nxt-smux-port", - "num_modes": 2, - "prefix": "mux", - "source_file": "drivers/lego/sensors/ht_nxt_smux.c", - "source_line": 39, - "url_name": "ht-nxt-smux-port" - }, - { - "connection_types": "EV3/UART, Other/UART, NXT/I2C, Other/I2C, EV3/Analog, NXT/Analog", - "description": "EV3 Input Port", - "mode_info": [ - { - "description": "Automatically detect sensors.", - "id": "EV3_INPUT_PORT_MODE_AUTO", - "name": "auto", - "name_footnote": "[^auto-mode]", - "notes": "\n[^auto-mode]: In auto mode, the port will attempt to\n automatically detect the type of sensor that was connected\n and load the appropriate driver. See the list of [supported\n sensors] to determine if a sensor can be automatically\n detected.\n ^\n [supported sensors]: /docs/sensors/#supported-sensors\n \n " - }, - { - "description": "Load the [nxt-analog] device.", - "id": "EV3_INPUT_PORT_MODE_NXT_ANALOG", - "name": "nxt-analog", - "name_footnote": "[^nxt-analog-mode]", - "notes": "\n[^nxt-analog-mode]: This loads the [generic NXT/Analog sensor]\n [nxt-analog] driver. Use `set_device` to load the appropriate\n device/driver.\n ^\n [nxt-analog]: /docs/sensors/generic-nxt-analog-sensor\n \n " - }, - { - "description": "Load the [nxt-color-sensor] device.", - "id": "EV3_INPUT_PORT_MODE_NXT_COLOR", - "name": "nxt-color", - "name_footnote": "[^nxt-color-mode]", - "notes": "\n[^nxt-color-mode]: NXT Color sensor driver has not been\n implemented yet, so right now, this mode does nothing.\n \n " - }, - { - "description": "Configure for I2C communications and load the [nxt-i2c-host] device.", - "id": "EV3_INPUT_PORT_MODE_NXT_I2C", - "name": "nxt-i2c" - }, - { - "description": "Load the [ev3-analog] device.", - "id": "EV3_INPUT_PORT_MODE_EV3_ANALOG", - "name": "ev3-analog" - }, - { - "description": "Configure for UART communications and load the [ev3-uart-host] device.", - "id": "EV3_INPUT_PORT_MODE_EV3_UART", - "name": "ev3-uart" - }, - { - "description": "Configure for UART communications but do not load any device.", - "id": "EV3_INPUT_PORT_MODE_OTHER_UART", - "name": "other-uart" - }, - { - "description": "Provide access to low level drivers.", - "id": "EV3_INPUT_PORT_MODE_RAW", - "name": "raw", - "name_footnote": "[^raw-mode]", - "notes": "\n[^raw-mode]: Exports gpios and analog/digital converter values\n to sysfs so that they can be controlled directly.\n \n " - } - ], - "module": "legoev3-ports", - "name": "legoev3-input-port", - "num_modes": 8, - "prefix": "in", - "source_file": "drivers/lego/ev3/legoev3_ports_in.c", - "source_line": 291, - "url_name": "legoev3-input-port" - }, - { - "connection_types": "tacho-motor, dc-motor, led", - "description": "EV3 Output Port", - "mode_info": [ - { - "description": "Automatically detect motors when they are connected.", - "id": "EV3_OUTPUT_PORT_MODE_AUTO", - "name": "auto", - "name_footnote": "[^auto-mode]", - "notes": "\n[^auto-mode]: Only the EV3/NXT large motors and the EV3\n medium motor can be automatically detected. All other devices\n must be manually configured.\n \n " - }, - { - "description": "Load the [legoev3-motor] device.", - "id": "EV3_OUTPUT_PORT_MODE_TACHO_MOTOR", - "name": "legoev3-motor", - "name_footnote": "[^legoev3-motor-mode]", - "notes": "\n[^legoev3-motor-mode]: Configures the port to use the\n [legoev3-motor] driver module. The default driver is the\n EV3/NXT Large Motor (`lego-ev3-l-motor`). You can change\n the driver using the `set_device` attribute.\n ^\n [legoev3-motor]: /docs/drivers/legoev3-motor\n \n " - }, - { - "description": "Load the [rcx-motor] device.", - "id": "EV3_OUTPUT_PORT_MODE_DC_MOTOR", - "name": "rcx-motor", - "name_footnote": "[^rcx-motor-mode]", - "notes": "\n[^rcx-motor-mode]: This can be use with MINDSTORMS RCX\n motors, Power Functions motors and any other 'plain' DC\n motor. By 'plain', we mean the motor is just a motor without\n any feedback.\n ^\n [rcx-motor]: /docs/drivers/rcx-motor\n \n " - }, - { - "description": "Load the [rcx-led] device.", - "id": "EV3_OUTPUT_PORT_MODE_LED", - "name": "rcx-led", - "name_footnote": "[^rcx-led-mode]", - "notes": "\n[^rcx-led-mode]: This can be used with MINDSTORMS RCX LEDs,\n Power Functions LEDs or any other LED connected to pins 1\n and 2 of the output port.\n ^\n [rcx-led]: /docs/drivers/rcx-led\n \n " - }, - { - "description": "Provide access to low level drivers.", - "id": "EV3_OUTPUT_PORT_MODE_RAW", - "name": "raw", - "name_footnote": "[^raw-mode]", - "notes": "\n[^raw-mode]: Exports gpios, pwm and analog/digital converter\n values to sysfs so that they can be controlled directly.\n \n " - } - ], - "module": "legoev3-ports", - "name": "legoev3-output-port", - "num_modes": 5, - "prefix": "out", - "source_file": "drivers/lego/ev3/legoev3_ports_out.c", - "source_line": 110, - "url_name": "legoev3-output-port" - }, - { - "connection_types": "EV3/UART, EV3/Analog", - "description": "mindsensors.com EV3 Sensor Multiplexer Input Port", - "mode_info": [ - { - "description": "EV3/UART sensor", - "id": "MS_EV3_SMUX_MODE_UART", - "name": "uart", - "name_footnote": "[^uart-mode]", - "notes": "\n[^uart-mode]: UART sensor types are not automatically\n detected. By default, the `lego-ev3-color` driver\n will be loaded when this mode is set.\n Use `set_device` to load other sensor devices/drivers.\n \n Supported sensors are:\n \n | Sensor Name | Device/Driver Name |\n |---------------------|--------------------|\n | LEGO EV3 Color | `lego-ev3-color` |\n | LEGO EV3 Ultrasonic | `lego-ev3-us` |\n | LEGO EV3 GYRO | `lego-ev3-gyro` |\n | LEGO EV3 Infrared | `lego-ev3-ir` |\n \n " - }, - { - "description": "EV3/Analog sensor", - "id": "MS_EV3_SMUX_MODE_ANALOG", - "name": "analog", - "name_footnote": "[^analog-mode]", - "notes": "\n[^analog-mode]: Currently only the LEGO EV3 Touch sensor is\n supported. The `lego-ev3-touch` device/driver is loaded when\n this mode is set.\n \n " - } - ], - "module": "ms-ev3-smux", - "name": "ms-ev3-smux-port", - "num_modes": 2, - "prefix": "mux", - "source_file": "drivers/lego/sensors/ms_ev3_smux.c", - "source_line": 42, - "url_name": "ms-ev3-smux-port" - }, - { - "connection_types": "WeDo/Analog, dc-motor, led", - "description": "LEGO WeDo Port", - "mode_info": [ - { - "description": "Automatic", - "id": "0", - "name": "auto" - } - ], - "module": "wedo", - "name": "wedo-port", - "num_modes": 1, - "prefix": "wedo", - "source_file": "drivers/lego/wedo/wedo_port.c", - "source_line": 410, - "url_name": "wedo-port" - } -] diff --git a/_data/sensors.json b/_data/sensors.json deleted file mode 100644 index fb0f639aa..000000000 --- a/_data/sensors.json +++ /dev/null @@ -1,3045 +0,0 @@ -[ - { - "id": "GENERIC_EV3_ANALOG_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value", - "id": "0", - "name": "ANALOG", - "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", - "source_file": "drivers/lego/sensors/ev3_analog_sensor_defs.c", - "source_line": 48, - "url_name": "generic-ev3-analog-sensor", - "vendor_part_name": "Generic EV3 Analog Sensor" - }, - { - "analog_mode_info": [ - { - "id": "0", - "pin5_state": "LEGO_PORT_GPIO_LOW" - }, - { - "id": "1", - "pin5_state": "LEGO_PORT_GPIO_HIGH" - } - ], - "id": "GENERIC_NXT_ANALOG_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value", - "id": "0", - "name": "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": "LEGO_SENSOR_DATA_S32", - "decimals": "3", - "description": "Raw analog value
Pin 5 high", - "id": "1", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "url_name": "generic-nxt-analog-sensor", - "vendor_part_name": "Generic NXT Analog 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", - "mode_info": [ - { - "description": "Color", - "id": "0", - "name": "COLOR", - "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": "RED", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Green component", - "id": "2", - "name": "GREEN", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Blue component", - "id": "3", - "name": "BLUE", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_U16", - "description": "Raw values", - "id": "4", - "name": "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": "NORM", - "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": "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "hitechnic-nxt-color-sensor", - "vendor_id": "HiTechnc", - "vendor_name": "HiTechnic", - "vendor_part_name": "NXT Color Sensor" - }, - { - "cmd_info": [ - { - "description": "Reset accumulated angle", - "id": "0", - "name": "RESET" - }, - { - "description": "Reset accumulated angle and save to EEPROM", - "id": "1", - "name": "CAL", - "name_footnote": "[^calibrate]", - "notes": "\n[^calibrate]: When Calibrating the sensor wait\n least 25ms before further reads from the sensor.\n That means disable polling by setting `poll_ms`\n to 0 before sending this command.\n \n " - } - ], - "default_address": "0x01", - "i2c_cmd_info": [ - { - "cmd_data": "0", - "cmd_reg": "0", - "id": "0" - }, - { - "cmd_data": "0", - "cmd_reg": "0", - "id": "1" - } - ], - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0" - } - ], - "id": "HT_NXT_ANGLE_SENSOR", - "mode_info": [ - { - "description": "Angle", - "id": "0", - "name": "ANGLE", - "raw_max": "180", - "si_max": "180", - "units": "deg", - "units_description": "degrees", - "value0": "Angle (0 to 180)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Accumulated angle", - "figures": "9", - "id": "1", - "name": "ANGLE-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": "LEGO_SENSOR_DATA_S16", - "description": "Rotational speed", - "id": "2", - "name": "SPEED", - "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)" - } - ], - "name": "ht-nxt-angle", - "num_commands": "2", - "num_modes": "3", - "product_id": "AnglSnsr", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "description": "Single-axis acceleration", - "id": "0", - "name": "ACCEL", - "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": "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "decimals": "1", - "description": "Barometric Pressure", - "id": "0", - "name": "PRESS", - "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": "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "description": "Color", - "id": "0", - "name": "COLOR", - "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": "RED", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Green component", - "id": "2", - "name": "GREEN", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "Blue component", - "id": "3", - "name": "BLUE", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "description": "White component", - "id": "4", - "name": "WHITE", - "value0": "Reflected light intensity (0 to 255)" - }, - { - "data_sets": "4", - "description": "Normalized values", - "id": "5", - "name": "NORM", - "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": "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": "LEGO_SENSOR_DATA_U16", - "description": "Raw values", - "id": "7", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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": [ - { - "id": "0", - "pin5_state": "LEGO_PORT_GPIO_HIGH" - }, - { - "id": "1", - "pin5_state": "LEGO_PORT_GPIO_LOW" - } - ], - "id": "HT_EOPD_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Proximity (long range)", - "id": "0", - "name": "LONG", - "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 ", - "scale": "ht_eopd_sensor_scale", - "value0": "Proximity (0-100)", - "value0_footnote": "[^adjusted-value]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Proximity (short range)", - "id": "1", - "name": "SHORT", - "scale": "ht_eopd_sensor_scale", - "value0": "Proximity (0-100)", - "value0_footnote": "[^adjusted-value]" - } - ], - "name": "ht-nxt-eopd", - "num_modes": "2", - "sensor_type": "nxt-analog-sensor", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Raw value (non-linear)", - "id": "0", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Angular speed", - "id": "0", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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", - "mode_info": [ - { - "description": "???", - "id": "0", - "name": "IRLINK", - "value0": "???" - } - ], - "name": "ht-nxt-ir-link", - "num_modes": "1", - "product_id": "IRLink", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Single Motor Control", - "id": "0", - "name": "1-MOTOR", - "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": "LEGO_SENSOR_DATA_S8", - "description": "Eight Motor Controls", - "id": "1", - "name": "8-MOTOR", - "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "description": "IR Proximity", - "id": "0", - "name": "PROX", - "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Compass Direction", - "id": "0", - "name": "COMPASS", - "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Magnetic field???", - "id": "0", - "name": "MAG", - "pct_max": "100", - "raw_max": "5000", - "si_max": "1023", - "value0": "???" - } - ], - "name": "ht-nxt-mag", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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", - "mode_info": [ - { - "description": "Direction (unmodulated)", - "id": "0", - "name": "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": "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": "DC-ALL", - "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": "AC-ALL", - "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-seek-v2", - "num_modes": "4", - "product_id": "NewIRDir", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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" - }, - { - "cmd_info": [ - { - "description": "Halt", - "id": "0", - "name": "HALT" - }, - { - "description": "Start auto-detection", - "id": "1", - "name": "DETECT", - "name_footnote": "[^auto-detect],[^auto-detect-sensors]", - "notes": "\n[^auto-detect]: The sensor mux must be halted before\n sending the detect command, otherwise it will result\n an error (-EPERM).\n \n \n[^auto-detect-sensors]: Only these sensors can be\n automatically 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 \n " - }, - { - "description": "Run", - "id": "2", - "name": "RUN" - } - ], - "default_address": "0x08", - "device_class_footnote": "[^more-devices]", - "i2c_cmd_info": [ - { - "cmd_data": "HT_NXT_SMUX_COMMAND_HALT", - "cmd_reg": "HT_NXT_SMUX_COMMAND_REG", - "id": "0" - }, - { - "cmd_data": "HT_NXT_SMUX_COMMAND_DETECT", - "cmd_reg": "HT_NXT_SMUX_COMMAND_REG", - "id": "1" - }, - { - "cmd_data": "HT_NXT_SMUX_COMMAND_RUN", - "cmd_reg": "HT_NXT_SMUX_COMMAND_REG", - "id": "2" - } - ], - "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", - "mode_info": [ - { - "data_sets": "2", - "description": "Status", - "id": "0", - "name": "MUX", - "notes": "\n[^state]: Run state:\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": "Run state", - "value0_footnote": "[^state]", - "value1": "Status", - "value1_footnote": "[^status-bits]" - } - ], - "name": "ht-nxt-smux", - "notes": "\n[^more-devices]: The `ht-nxt-smux` driver loads more devices\n in addition to the [lego-sensor] class device. See\n [ht-nxt-smux-port] for more information.\n ^\n [ht-nxt-smux-port]: /docs/ports/ht-nxt-smux-port\n \n ", - "num_commands": "3", - "num_modes": "1", - "ops": [], - "product_id": "SensrMUX", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "data_sets": "4", - "data_type": "LEGO_SENSOR_DATA_U16", - "description": "Analog inputs", - "id": "0", - "name": "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": "DIN", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Digital outputs", - "id": "2", - "name": "DOUT", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Digital input/output controls", - "id": "3", - "name": "DCTRL", - "value0": "Bits B0-B7 (0 to 255)" - }, - { - "description": "Strobe output", - "id": "4", - "name": "STROBE", - "value0": "Bits S0-S3 (0 to 15)" - }, - { - "description": "LED control", - "id": "5", - "name": "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": "AOUT-0", - "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": "AOUT-1", - "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", - "pin1_state": "LEGO_PORT_GPIO_HIGH", - "product_id": "SuperPro", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "1", - "description": "Continuous measurement
LEDs: On, steady", - "id": "0", - "name": "US-DIST-CM", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0-2550)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "1", - "description": "Continuous measurement
LEDs: On, steady", - "id": "1", - "name": "US-DIST-IN", - "units": "in", - "units_description": "inches", - "value0": "Distance (0-1003)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S8", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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": "lego-ev3-us", - "num_modes": "7", - "num_view_modes": "3", - "sensor_type": "ev3-uart-sensor", - "source_file": "drivers/lego/sensors/ev3_uart_sensor_defs.c", - "source_line": 25, - "type_id": "LEGO_EV3_ULTRASONIC_TYPE_ID", - "url_name": "lego-ev3-ultrasonic-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Ultrasonic Sensor", - "vendor_part_number": "45504" - }, - { - "id": "LEGO_EV3_GYRO", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Raw sensor value ???", - "id": "2", - "name": "GYRO-FAS", - "value0": "??? (-1464 to 1535)", - "value0_footnote": "[^direction]" - }, - { - "data_sets": "2", - "data_type": "LEGO_SENSOR_DATA_S16", - "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", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Calibration ???", - "id": "4", - "name": "GYRO-CAL", - "value0": "???", - "value1": "???", - "value2": "???", - "value3": "???" - } - ], - "name": "lego-ev3-gyro", - "num_modes": "5", - "num_view_modes": "3", - "sensor_type": "ev3-uart-sensor", - "source_file": "drivers/lego/sensors/ev3_uart_sensor_defs.c", - "source_line": 25, - "type_id": "LEGO_EV3_GYRO_TYPE_ID", - "url_name": "lego-ev3-gyro-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Gyro Sensor", - "vendor_part_number": "45505" - }, - { - "id": "LEGO_EV3_COLOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Reflected light
LED color: red", - "id": "0", - "name": "COL-REFLECT", - "units": "pct", - "units_description": "percent", - "value0": "Reflected light intensity (0 to 100)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Ambient light
LED color: blue (dimly lit)", - "id": "1", - "name": "COL-AMBIENT", - "units": "pct", - "units_description": "percent", - "value0": "Ambient light intensity (0 to 100)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Color
LED color: white (all LEDs rapidly cycling)", - "id": "2", - "name": "COL-COLOR", - "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", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Raw Reflected
LED color: red", - "id": "3", - "name": "REF-RAW", - "value0": "??? (0 to 1020???)", - "value1": "??? (0 to 1020???)" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Raw Color Components
LED color: white (all LEDs rapidly cycling)", - "id": "4", - "name": "RGB-RAW", - "units_description": "color", - "value0": "Red??? (0 to 1020???)", - "value1": "Green??? (0 to 1020???)", - "value2": "Blue??? (0 to 1020???)" - }, - { - "data_sets": "4", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Calibration ???
LED color: red, flashing every 4 seconds, then goes continous", - "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": "lego-ev3-color", - "num_modes": "6", - "num_view_modes": "3", - "sensor_type": "ev3-uart-sensor", - "source_file": "drivers/lego/sensors/ev3_uart_sensor_defs.c", - "source_line": 25, - "type_id": "LEGO_EV3_COLOR_TYPE_ID", - "url_name": "lego-ev3-color-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Color Sensor", - "vendor_part_number": "45506" - }, - { - "id": "LEGO_EV3_TOUCH_SENSOR", - "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 ", - "scale": "lego_ev3_touch_sensor_scale", - "value0": "State (0 or 1)", - "value0_footnote": "[^mode0-value]" - } - ], - "name": "lego-ev3-touch", - "num_modes": "1", - "sensor_type": "ev3-analog-sensor", - "source_file": "drivers/lego/sensors/ev3_analog_sensor_defs.c", - "source_line": 48, - "url_name": "lego-ev3-touch-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Touch Sensor", - "vendor_part_number": "45507" - }, - { - "id": "LEGO_EV3_INFRARED", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S8", - "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", - "data_type": "LEGO_SENSOR_DATA_S8", - "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", - "data_type": "LEGO_SENSOR_DATA_S8", - "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]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "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", - "data_type": "LEGO_SENSOR_DATA_S8", - "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", - "units_description": "percent", - "value0": "??? (0 to 100)", - "value1": "??? (0 to 100)", - "value2": "??? (0 to 100)", - "value3": "??? (0 to 100)" - }, - { - "data_sets": "2", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Calibration ???", - "id": "5", - "name": "IR-CAL", - "value0": "??? (0 to 1023)", - "value1": "??? (0 to 1023)" - } - ], - "name": "lego-ev3-ir", - "num_modes": "6", - "num_view_modes": "3", - "sensor_type": "ev3-uart-sensor", - "source_file": "drivers/lego/sensors/ev3_uart_sensor_defs.c", - "source_line": 25, - "type_id": "LEGO_EV3_INFRARED_TYPE_ID", - "url_name": "lego-ev3-infrared-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "EV3 Infrared Sensor", - "vendor_part_number": "45509" - }, - { - "cmd_info": [ - { - "description": "Turns off the outputs of the ports.", - "id": "WEDO_HUB_CMD_OUTPUT_OFF", - "name": "OUT-OFF" - }, - { - "description": "Turns on the outputs of the ports.", - "id": "WEDO_HUB_CMD_OUTPUT_ON", - "name": "OUT-ON" - }, - { - "description": "Clears error.", - "id": "WEDO_HUB_CMD_CLEAR_ERROR", - "name": "CLEAR-ERR" - } - ], - "id": "0", - "mode_info": [ - { - "data_sets": "2", - "data_type": "LEGO_SENSOR_DATA_U16", - "description": "Hub status", - "id": "WEDO_HUB_MODE_HUB", - "name": "HUB", - "notes": "\n[^status-bits]: Status Bits:\n \n | Bit | Description |\n |:---:|:-----------:|\n | 0 | Echo |\n | 1 | |\n | 2 | |\n | 3 | |\n | 4 | |\n | 5 | |\n | 6 | High Power |\n | 7 | Outputs Off |\n \n ", - "value0": "Status bits", - "value0_footnote": "[^status-bits]", - "value1": "Voltage (millivolts)" - } - ], - "module": "wedo", - "name": "wedo-hub", - "num_commands": "3", - "num_modes": "1", - "sensor_type": "wedo-hub-sensor", - "source_file": "drivers/lego/wedo/wedo_hub.c", - "source_line": 74, - "url_name": "lego-wedo-usb-hub", - "vendor_name": "LEGO", - "vendor_part_name": "WeDo USB Hub", - "vendor_part_number": "9581", - "vendor_website": "https://education.lego.com/en-us/lego-education-product-database/wedo/9581-lego-usb-hub" - }, - { - "id": "WEDO_MOTION_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_U8", - "description": "Proximity", - "id": "0", - "name": "PROX", - "raw_max": "219", - "raw_min": "71", - "si_max": "100", - "units": "pct", - "units_description": "percent", - "value0": "Proximity (0 - 100)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_U8", - "description": "Raw analog value", - "id": "1", - "name": "RAW", - "value0": "Proximity (0 - 255)" - } - ], - "module": "wedo", - "name": "wedo-motion", - "num_modes": "2", - "sensor_type": "wedo-sensor", - "source_file": "drivers/lego/wedo/wedo_sensor.c", - "source_line": 122, - "url_name": "lego-wedo-motion-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "WeDo Motion Sensor", - "vendor_part_number": "9583", - "vendor_website": "http://education.lego.com/en-us/lego-education-product-database/wedo/9583-motion-sensor" - }, - { - "id": "WEDO_TILT_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_U8", - "description": "Tilt status", - "id": "0", - "name": "TILT", - "notes": "\n[^tilt-values]: Tilt values:\n \n | Value | Description |\n |-------|-------------|\n | 0 | Level |\n | 1 | Front |\n | 2 | Back |\n | 3 | Left |\n | 4 | Right |\n | 5 | Unknown |\n \n ", - "scale": "wedo_tilt_scale", - "value0": "Tilt (0 to 5)", - "value0_footnote": "[^tilt-values]" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Tilt around 2 separate axes", - "id": "1", - "name": "TILT-AXIS", - "notes": "\n[^axis-values]: Axis values:\n \n | Value0 | Value1 | Value2 | Description |\n |--------|--------|--------|-------------|\n | 0 | 0 | 1 | Level |\n | 0 | 1 | 1 | Front |\n | 0 | -1 | 1 | Back |\n | -1 | 0 | 1 | Left |\n | 1 | 0 | 1 | Right |\n | 0 | 0 | 0 | Unknown |\n \n ", - "scale": "wedo_tilt_axis_scale", - "value0": "Tilt Left/Right (-1/0/1)", - "value0_footnote": "[^axis-values]", - "value1": "Tilt Back/Front (-1/0/1)", - "value1_footnote": "[^axis-values]", - "value2": "Tilt value valid (0/1)", - "value2_footnote": "[^axis-values]" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_U8", - "description": "Raw analog value", - "id": "2", - "name": "RAW", - "notes": "\n[^raw-values]: Raw values:\n \n | Value | Description |\n |-------|-------------|\n | 0 | Unknown |\n | < 48 | Back |\n | < 99 | Right |\n | < 153 | Level |\n | < 204 | Front |\n | < 255 | Left |\n \n ", - "value0": "Tilt (0 - 255)", - "value0_footnote": "[^raw-values]" - } - ], - "module": "wedo", - "name": "wedo-tilt", - "num_modes": "3", - "sensor_type": "wedo-sensor", - "source_file": "drivers/lego/wedo/wedo_sensor.c", - "source_line": 122, - "url_name": "lego-wedo-tilt-sensor", - "vendor_name": "LEGO", - "vendor_part_name": "WeDo Tilt Sensor", - "vendor_part_number": "9584", - "vendor_website": "http://education.lego.com/en-us/lego-education-product-database/wedo/9584-tilt-sensor" - }, - { - "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", - "mode_info": [ - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Voltage", - "id": "0", - "name": "IN-VOLT", - "raw_max": "10000", - "si_max": "10000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 to 10000)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Current", - "id": "1", - "name": "IN-AMP", - "raw_max": "10000", - "si_max": "10000", - "units": "A", - "units_description": "amps", - "value0": "Current (0 to 10000)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Voltage", - "id": "2", - "name": "OUT-VOLT", - "raw_max": "10000", - "si_max": "10000", - "units": "V", - "units_description": "volts", - "value0": "Voltage (0 to 10000)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Current", - "id": "3", - "name": "OUT-AMP", - "raw_max": "10000", - "si_max": "10000", - "units": "A", - "units_description": "amps", - "value0": "Current (0 to 10000)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "description": "Energy", - "id": "4", - "name": "JOULE", - "raw_max": "100", - "si_max": "100", - "units": "J", - "units_description": "Joules", - "value0": "Energy (0 to 100)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Input Power", - "id": "5", - "name": "IN-WATT", - "raw_max": "10000", - "si_max": "10000", - "units": "W", - "units_description": "Watts", - "value0": "Power (0 to 10000)" - }, - { - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "Output Power", - "id": "6", - "name": "OUT-WATT", - "raw_max": "10000", - "si_max": "10000", - "units": "W", - "units_description": "Watts", - "value0": "Power (0 to 10000)" - }, - { - "data_sets": "7", - "data_type": "LEGO_SENSOR_DATA_S16_BE", - "decimals": "3", - "description": "All", - "id": "7", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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", - "source_file": "drivers/lego/sensors/other_sensor_defs.c", - "source_line": 28, - "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/" - }, - { - "id": "LEGO_NXT_TOUCH_SENSOR", - "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 ", - "scale": "nxt_touch_sensor_scale", - "value0": "State (0 or 1)", - "value0_footnote": "[^mode0-value]" - } - ], - "name": "lego-nxt-touch", - "num_modes": "1", - "sensor_type": "nxt-analog-sensor", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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": "LEGO_PORT_GPIO_HIGH" - }, - { - "id": "1", - "pin5_state": "LEGO_PORT_GPIO_LOW" - } - ], - "id": "LEGO_NXT_LIGHT_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "decimals": "1", - "description": "Reflected light
LED on", - "id": "0", - "name": "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": "LEGO_SENSOR_DATA_S32", - "decimals": "1", - "description": "Ambient light
LED off", - "id": "1", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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": "LEGO_PORT_GPIO_LOW" - }, - { - "id": "1", - "pin5_state": "LEGO_PORT_GPIO_HIGH" - } - ], - "id": "LEGO_NXT_SOUND_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "decimals": "1", - "description": "Sound pressure level
Flat weighting", - "id": "0", - "name": "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": "LEGO_SENSOR_DATA_S32", - "decimals": "1", - "description": "Sound pressure level
A weighting", - "id": "1", - "name": "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "2", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "3", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - }, - { - "id": "4", - "read_data_reg": "0", - "set_mode_data": "0", - "set_mode_reg": "0" - } - ], - "id": "LEGO_NXT_ULTRASONIC_SENSOR", - "mode_info": [ - { - "description": "Continuous measurement", - "id": "0", - "name": "US-DIST-CM", - "units": "cm", - "units_description": "centimeters", - "value0": "Distance (0 to 255)" - }, - { - "decimals": "1", - "description": "Continuous measurement", - "id": "1", - "name": "US-DIST-IN", - "si_max": "1000", - "units": "in", - "units_description": "inches", - "value0": "Distance (0 to 1000)" - }, - { - "description": "Single measurement", - "id": "2", - "name": "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 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": "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": "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 ", - "raw_max": "1", - "si_max": "1", - "value0": "Presence (0 or 1)", - "value0_footnote": "[^listen-value]" - } - ], - "name": "lego-nxt-us", - "num_modes": "5", - "num_read_only_modes": "2", - "pin1_state": "LEGO_PORT_GPIO_HIGH", - "product_id": "Sonar", - "sensor_type": "nxt-i2c-sensor", - "slow": "true", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "lego-nxt-ultrasonic-sensor", - "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/" - }, - { - "cmd_info": [ - { - "description": "Reset device", - "id": "0", - "name": "RESET", - "name_footnote": "[^reset-description]", - "notes": "\n[^reset-description]: Recalculate bias drift, reset accumulated angle,\n set accelerometer scaling factor to 2G,\n this has to be done with sensor not moving\n and is strongly recommended to be called manually before work\n \n " - }, - { - "description": "Set accelerometer scaling to 2G", - "id": "1", - "name": "ACCEL-2G" - }, - { - "description": "Set accelerometer scaling to 4G", - "id": "2", - "name": "ACCEL-4G" - }, - { - "description": "Set accelerometer scaling to 8G", - "id": "3", - "name": "ACCEL-8G" - } - ], - "default_address": "0x01", - "i2c_cmd_info": [ - { - "cmd_reg": "0", - "id": "0" - }, - { - "cmd_reg": "0", - "id": "1" - }, - { - "cmd_reg": "0", - "id": "2" - }, - { - "cmd_reg": "0", - "id": "3" - } - ], - "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": "MI_CRUIZCORE_XG1300L", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "2", - "description": "Angle", - "id": "0", - "name": "ANGLE", - "units": "deg", - "units_description": "degrees", - "value0": "Z-axis angle (-18000 to 18000)" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "2", - "description": "Rotational speed", - "id": "1", - "name": "SPEED", - "units": "d/s", - "units_description": "degrees per second", - "value0": "Z-axis rotational speed" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "3", - "description": "Acceleration in X, Y, Z axis", - "id": "2", - "name": "ACCEL", - "notes": "\n[^gravity-units]: 1 g ~ 9.81\u00a0m/s2\n \n ", - "scale": "mi_xg1300l_scale", - "units": "g", - "units_description": "Standard gravity", - "units_footnote": "[^gravity-units]", - "value0": "Acceleration in X axis", - "value1": "Acceleration in Y axis", - "value2": "Acceleration in Z axis" - }, - { - "data_sets": "5", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "All values", - "id": "3", - "name": "ALL", - "notes": "\n[^mode3-angle]: Two decimal places\n \n[^mode3-speed]: Two decimal places\n \n[^mode3-accel]: Three decimal places,\n range as was set by last command\n \n ", - "scale": "mi_xg1300l_scale", - "value0": "Z-axis angle (-18000 to 18000)", - "value0_footnote": "[^mode3-angle]", - "value1": "Z-axis rotational speed", - "value1_footnote": "[^mode3-speed]", - "value2": "X-axis acceleration", - "value2_footnote": "[^mode3-accel]", - "value3": "Y-axis acceleration", - "value3_footnote": "[^mode3-accel]", - "value4": "Z-axis acceleration", - "value4_footnote": "[^mode3-accel]" - } - ], - "name": "mi-xg1300l", - "notes": "\n[^ids]: CruizCore XG1300L doesn't follow LEGO guidelines by\n returning vendor, product and firmware version values. As a\n result, this sensor can't be automatically detected. Until\n we find another way to identify the sensor, the driver has to\n be loaded manually.\n \n Register I2C device:\n
\n    echo mi-xg1300l 0x01 > /sys/bus/i2c/devices/i2c-/new_device\n    
\n \n ", - "num_commands": "4", - "num_modes": "4", - "num_read_only_modes": "4", - "ops": [], - "product_id": "XG1300L", - "product_id_footnote": "[^ids]", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "microinfinity-digital-gyroscope-and-accelerometer", - "vendor_id": "mnfinity", - "vendor_id_footnote": "[^ids]", - "vendor_name": "Microinfinity", - "vendor_part_name": "Digital Gyroscope And Accelerometer", - "vendor_part_number": "CruizCore XG 1300L", - "vendor_website": "http://www.minfinity.com/eng/page.php?Main=1&sub=1&tab=5" - }, - { - "cmd_info": [ - { - "description": "Begin compass calibration", - "id": "0", - "name": "BEGIN-COMP-CAL" - }, - { - "description": "End compass calibration", - "id": "1", - "name": "END-COMP-CAL" - }, - { - "description": "Change accelerometer sensitivity to 2G and gyro sensitivity to 250 deg/sec", - "id": "2", - "name": "ACCEL-2G", - "name_footnote": "[^accel-commands]", - "notes": "\n[^accel-commands]: Wait 50 msec after sending command for sensor to reconfigure itself.\n \n " - }, - { - "description": "Change accelerometer sensitivity to 4G and gyro sensitivity to 500 deg/sec", - "id": "3", - "name": "ACCEL-4G", - "name_footnote": "[^accel-commands]" - }, - { - "description": "Change accelerometer sensitivity to 8G and gyro sensitivity to 2000 deg/sec", - "id": "4", - "name": "ACCEL-8G", - "name_footnote": "[^accel-commands]" - }, - { - "description": "Change accelerometer sensitivity to 16G and gyro sensitivity to 2000 deg/sec", - "id": "5", - "name": "ACCEL-16G", - "name_footnote": "[^accel-commands]" - } - ], - "default_address": "0x11", - "default_address_footnote": "[^address]", - "i2c_cmd_info": [ - { - "cmd_data": "'C'", - "cmd_reg": "0", - "id": "0" - }, - { - "cmd_data": "'c'", - "cmd_reg": "0", - "id": "1" - }, - { - "cmd_data": "'1'", - "cmd_reg": "0", - "id": "2" - }, - { - "cmd_data": "'2'", - "cmd_reg": "0", - "id": "3" - }, - { - "cmd_data": "'3'", - "cmd_reg": "0", - "id": "4" - }, - { - "cmd_data": "'4'", - "cmd_reg": "0", - "id": "5" - } - ], - "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": "MS_ABSOLUTE_IMU", - "mode_info": [ - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_U8", - "description": "Tilt", - "id": "0", - "name": "TILT", - "scale": "ms_imu_scale", - "units": "deg", - "units_description": "degrees", - "value0": "X-axis angle (0 to 180)", - "value1": "Y-axis angle (0 to 180)", - "value2": "Y-axis angle (0 to 180)" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Acceleration", - "id": "1", - "name": "ACCEL", - "name_footnote": "[^accel]", - "notes": "\n[^accel]: Only returns data from models with an accelerometer\n (AbsoluteIMU-AC/AbsoluteIMU-A).\n \n[^gravity-units]: 1 g = 9.81 m/s2\n \n ", - "units": "g", - "units_description": "Standard gravity", - "value0": "X-axis acceleration", - "value1": "Y-axis acceleration", - "value2": "Z-axis acceleration" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_U16", - "description": "Compass", - "id": "2", - "name": "COMPASS", - "name_footnote": "[^compass]", - "notes": "\n[^compass]: Only returns data from models with a compass\n (AbsoluteIMU-C/AbsoluteIMU-AC/AbsoluteIMU-ACG).\n \n ", - "units": "deg", - "units_description": "degrees", - "value0": "Heading (0 to 360)" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Magnetic field", - "id": "3", - "name": "MAG", - "name_footnote": "[^compass]", - "value0": "X-axis magnetic field", - "value1": "Y-axis magnetic field", - "value2": "Z-axis magnetic field" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S16", - "decimals": "1", - "description": "Gyro", - "id": "4", - "name": "GYRO", - "name_footnote": "[^gyro]", - "notes": "\n[^gyro]: Only returns data from models with a gyro\n (AbsoluteIMU-ACG).\n \n ", - "raw_max": "10000", - "si_max": "875", - "units": "d/s", - "units_description": "degrees per second", - "value0": "X-axis rotational speed", - "value1": "Y-axis rotational speed", - "value2": "Z-axis rotational speed" - }, - { - "data_sets": "23", - "description": "All data", - "id": "5", - "name": "ALL", - "name_footnote": "[^all]", - "notes": "\n[^all]: Reads all data from the sensor. Use `bin_data`\n attribute to read values. Some values will not be scaled.\n See manufacturer docs for more info.\n \n " - } - ], - "name": "ms-absolute-imu", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n ", - "num_commands": "6", - "num_modes": "6", - "ops": [], - "product_id": "AbsIMU", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "mindsensors.com-gyro-multisensitivity-accelerometer-and-compass", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Gyro, MultiSensitivity Accelerometer and Compass", - "vendor_part_number": "AbsoluteIMU(-A/C/G)", - "vendor_website": "http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=169&MMN_position=30:30" - }, - { - "cmd_info": [ - { - "description": "Reset angle values", - "id": "0", - "name": "RESET" - } - ], - "default_address": "0x18", - "i2c_cmd_info": [ - { - "cmd_data": "'r'", - "cmd_reg": "0", - "id": "0" - } - ], - "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": "MS_ANGLE_SENSOR", - "mode_info": [ - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "Angle", - "id": "0", - "name": "ANGLE", - "units": "deg", - "units_description": "degrees", - "value0": "Angle" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S32", - "decimals": "1", - "description": "High-precision angle", - "id": "1", - "name": "ANGLE2", - "raw_max": "360", - "si_max": "1800", - "units": "deg", - "units_description": "degrees", - "value0": "Angle" - }, - { - "data_sets": "1", - "data_type": "LEGO_SENSOR_DATA_S16", - "description": "Rotational Speed", - "id": "2", - "name": "SPEED", - "raw_max": "100", - "si_max": "100", - "units": "rpm", - "units_description": "revolutions per minute", - "value0": "Rotational Speed (-4000 to 4000)" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S32", - "description": "All values", - "id": "3", - "name": "ALL", - "notes": "\n[^mode3-value1]: Angle value times 2\n (i.e. value of 10 = angle of 5 degrees).\n Allows for 0.5 degree precision.\n \n[^mode3-value2]: Value needs to be converted to\n 16-bit signed integer. Example:\n `if (value2 > 32767) value2 = value2 - 65536`\n \n ", - "raw_max": "100", - "si_max": "100", - "value0": "Angle", - "value1": "Angle x2", - "value1_footnote": "[^mode3-value1]", - "value2": "Rotational Speed", - "value2_footnote": "[^mode3-value2]" - } - ], - "name": "ms-angle", - "num_commands": "1", - "num_modes": "4", - "product_id": "AngSens", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "mindsensors.com-glidewheel-as", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "GlideWheel-AS", - "vendor_part_number": "AngleSensor", - "vendor_website": "http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=173" - }, - { - "default_address": "0x50, 0x51, 0x52", - "default_address_footnote": "[^addresses]", - "device_class_footnote": "[^port-and-sensor-devices]", - "i2c_mode_info": [ - { - "id": "0" - } - ], - "id": "MS_EV3_SENSOR_MUX", - "mode_info": [ - { - "data_sets": "0", - "description": "EV3 Sensor Multiplexer", - "id": "0", - "name": "MUX", - "name_footnote": "[^mode]", - "notes": "\n[^mode]: This mode does not do anything useful.\n \n " - } - ], - "name": "ms-ev3-smux", - "notes": "\n[^addresses]: This sensor appears as three separate sensors,\n one for each channel on the sensor mux.\n \n[^port-and-sensor-devices]: In addition to loading three\n [lego-sensor] devices for the sensor mux itself, three\n [lego-port] devices are added as well. These [ms-ev3-smux-port]\n devices must be used to manually specify the type of sensor\n that is attached to each port.\n ^\n [lego-port]: /docs/drivers/lego-port-class\n [ms-ev3-smux-port]: /docs/ports/ms-ev3-smux-port\n \n ", - "num_modes": "2", - "num_read_only_modes": "1", - "ops": [], - "product_id": "Ev3SMux", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "mindsensors.com-ev3-sensor-multiplexer", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "EV3 Sensor Multiplexer", - "vendor_part_number": "EV3SensorMUX", - "vendor_website": "http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=207" - }, - { - "cmd_info": [ - { - "description": "Calibrate white", - "id": "0", - "name": "CAL-WHITE" - }, - { - "description": "Calibrate black", - "id": "1", - "name": "CAL-BLACK" - }, - { - "description": "Put sensor to sleep", - "id": "2", - "name": "SLEEP", - "name_footnote": "[^sleep]", - "notes": "\n[^sleep]: `poll_ms` must be set to `0` in order for sensor to sleep.\n \n " - }, - { - "description": "Wake up the sensor", - "id": "3", - "name": "WAKE", - "name_footnote": "[^wake]", - "notes": "\n[^wake]: Will return an error (-ENXIO) if sensor is actually asleep.\n Completes successfully if sensor is already awake.\n \n " - }, - { - "description": "Configures sensor for 60Hz electrical mains", - "id": "4", - "name": "60HZ" - }, - { - "description": "Configures sensor for 50Hz electrical mains", - "id": "5", - "name": "50HZ" - }, - { - "description": "Configures sensor for any (50/60Hz) electrical mains", - "id": "6", - "name": "UNIVERSAL" - } - ], - "default_address": "0x0A", - "default_address_footnote": "[^address]", - "i2c_cmd_info": [ - { - "cmd_data": "'W'", - "cmd_reg": "0", - "id": "0" - }, - { - "cmd_data": "'B'", - "cmd_reg": "0", - "id": "1" - }, - { - "cmd_data": "'D'", - "cmd_reg": "0", - "id": "2" - }, - { - "cmd_data": "'P'", - "cmd_reg": "0", - "id": "3" - }, - { - "cmd_data": "'A'", - "cmd_reg": "0", - "id": "4" - }, - { - "cmd_data": "'E'", - "cmd_reg": "0", - "id": "5" - }, - { - "cmd_data": "'U'", - "cmd_reg": "0", - "id": "6" - } - ], - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "MS_LIGHT_SENSOR_ARRAY", - "mode_info": [ - { - "data_sets": "8", - "description": "Calibrated values", - "id": "0", - "name": "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": "LEGO_SENSOR_DATA_S16", - "description": "Uncalibrated values", - "id": "1", - "name": "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 ???)" - } - ], - "name": "ms-light-array", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n ", - "num_commands": "7", - "num_modes": "2", - "product_id": "LSArray", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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" - }, - { - "cmd_info": [ - { - "description": "Calibrate white", - "id": "0", - "name": "CAL-WHITE" - }, - { - "description": "Calibrate black", - "id": "1", - "name": "CAL-BLACK" - }, - { - "description": "Put sensor to sleep", - "id": "2", - "name": "SLEEP", - "name_footnote": "[^sleep]", - "notes": "\n[^sleep]: `poll_ms` must be set to `0` in order for sensor to sleep.\n \n " - }, - { - "description": "Wake up the sensor", - "id": "3", - "name": "WAKE", - "name_footnote": "[^wake]", - "notes": "\n[^wake]: Will return an error (-ENXIO) if sensor is actually asleep.\n Completes successfully if sensor is already awake.\n \n " - }, - { - "description": "Color inversion (White line on a black background)", - "id": "4", - "name": "INV-COL" - }, - { - "description": "Reset Color inversion (black line on a white background).", - "id": "5", - "name": "RST-COL" - }, - { - "description": "Take a snapshot.", - "id": "6", - "name": "SNAP", - "name_footnote": "[^snapshot-command]", - "notes": "\n[^snapshot-command]: The \"SNAP\" command looks at the line\n under the sensor and stores the width and position of the\n line in sensor\u2019s memory. Subsequently, sensor will use\n these characteristics of line to track it. This command\n inverts the colors if it sees a white line on black background.\n (PID parameters are not affected).\n \n " - }, - { - "description": "Configures sensor for 60Hz electrical mains", - "id": "7", - "name": "60HZ" - }, - { - "description": "Configures sensor for 50Hz electrical mains", - "id": "8", - "name": "50HZ" - }, - { - "description": "Configures sensor for any (50/60Hz) electrical mains", - "id": "9", - "name": "UNIVERSAL" - } - ], - "default_address": "0x01", - "default_address_footnote": "[^address]", - "i2c_cmd_info": [ - { - "cmd_data": "'W'", - "cmd_reg": "0", - "id": "0" - }, - { - "cmd_data": "'B'", - "cmd_reg": "0", - "id": "1" - }, - { - "cmd_data": "'D'", - "cmd_reg": "0", - "id": "2" - }, - { - "cmd_data": "'P'", - "cmd_reg": "0", - "id": "3" - }, - { - "cmd_data": "'I'", - "cmd_reg": "0", - "id": "4" - }, - { - "cmd_data": "'R'", - "cmd_reg": "0", - "id": "5" - }, - { - "cmd_data": "'S'", - "cmd_reg": "0", - "id": "6" - }, - { - "cmd_data": "'A'", - "cmd_reg": "0", - "id": "7" - }, - { - "cmd_data": "'E'", - "cmd_reg": "0", - "id": "8" - }, - { - "cmd_data": "'U'", - "cmd_reg": "0", - "id": "9" - } - ], - "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": "MS_LINE_LEADER", - "mode_info": [ - { - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Line Follower", - "id": "0", - "name": "PID", - "notes": "\n[^pid-mode-value0]: \"Steering\" is the power value\n returned by the sensor to correct your course. Add\n this value to your left motor and subtract from\n right motor.\n \n ", - "units": "pct", - "units_description": "percent", - "value0": "Steering (-100 to 100)", - "value0_footnote": "[^pid-mode-value0]" - }, - { - "data_sets": "3", - "data_type": "LEGO_SENSOR_DATA_S8", - "description": "Line Follower - all values", - "id": "1", - "name": "PID-ALL", - "notes": "\n[^pid-mode-value1]: \"Average\" is the weighted average\n of the sensor reading. The average is a weighted\n average of the bits set to 1 based on the position.\n i.e. left most bit has weight of 10, second bit has\n weight of 20.\n \n[^pid-mode-value2]: \"Result\" is a byte value of\n the sensor reading. Each bit corresponding to the\n sensor where the line is seen is set to 1, or else\n the bit is zero.\n \n ", - "value0": "Steering (-100 to 100)", - "value0_footnote": "[^pid-mode-value0]", - "value1": "Average (0 to 80)", - "value1_footnote": "[^pid-mode-value1]", - "value2": "Result (as bits)", - "value2_footnote": "[^pid-mode-value2]" - }, - { - "data_sets": "8", - "description": "Calibrated values", - "id": "2", - "name": "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": "LEGO_SENSOR_DATA_S16", - "description": "Uncalibrated values", - "id": "3", - "name": "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 ???)" - } - ], - "name": "ms-line-leader", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n ", - "num_commands": "10", - "num_modes": "4", - "product_id": "LineLdr", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "mindsensors.com-line-follower-sensor", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Line Follower Sensor", - "vendor_part_number": "LineLeader", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=111" - }, - { - "default_address": "0x03", - "default_address_footnote": "[^address]", - "device_class_footnote": "[^tacho-motor-devices]", - "i2c_mode_info": [ - { - "id": "0", - "read_data_reg": "0" - }, - { - "id": "1", - "read_data_reg": "0" - } - ], - "id": "MS_NXTMMX", - "mode_info": [ - { - "data_sets": "1", - "decimals": "3", - "description": "Status", - "id": "0", - "name": "STATUS", - "raw_max": "255", - "si_max": "255", - "units": "V", - "units_description": "volts", - "value0": "Battery voltage" - }, - { - "data_sets": "1", - "decimals": "3", - "description": "Status (for older firmware versions)", - "id": "1", - "name": "STATUS-OLD", - "name_footnote": "[^status-old]", - "notes": "\n[^status-old]: The I2C register for battery voltage\n was changed for EV3 compatibility. If `STATUS` does\n not seem to work, try this mode instead.\n ", - "raw_max": "255", - "si_max": "255", - "units": "V", - "units_description": "volts", - "value0": "Battery voltage" - } - ], - "name": "ms-nxtmmx", - "notes": "\n[^address]: The address is programmable. See manufacturer\n documentation for more information.\n \n[^tacho-motor-devices]: The NxtMMX driver also loads two\n [tacho-motor] class devices. Use the tacho-motor class devices\n to actually control the motors. You can identify the motors\n by the `port_name` attribute. It will be `in:i2c:mux`\n where `` is A-D, `` is 3 (unless you changed the address)\n and `` is 1 or 2 (matches M1 or M2 printed on the NxtMMX).\n ^\n [tacho-motor]: /docs/drivers/tacho-motor-class\n \n ", - "num_modes": "2", - "ops": [], - "product_id": "NxTMMX", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "url_name": "mindsensors.com-multiplexer-for-nxt-ev3-motors", - "vendor_id": "mndsnsrs", - "vendor_name": "mindsensors.com", - "vendor_part_name": "Multiplexer for NXT/EV3 Motors", - "vendor_part_number": "NXTMMX-v2", - "vendor_website": "http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=134" - }, - { - "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", - "mode_info": [ - { - "decimals": "3", - "description": "EV3 Compatible", - "id": "0", - "name": "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": "OLD", - "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 [lego-sensor class] device. See the [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 [lego-sensor class]: /docs/drivers/lego-sensor-class\n [servo-motor class]: /docs/drivers/servo-motor-class\n \n ", - "num_modes": "2", - "ops": [], - "product_id": "NXTServo", - "sensor_type": "nxt-i2c-sensor", - "source_file": "drivers/lego/sensors/nxt_i2c_sensor_defs.c", - "source_line": 300, - "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/base)\n            # Pins are active low\n            for i in {0..7}\n            do\n                gpio=$(($base + $i))\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", - "source_file": "drivers/lego/sensors/other_sensor_defs.c", - "source_line": 62, - "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", - "source_file": "drivers/lego/sensors/other_sensor_defs.c", - "source_line": 106, - "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", - "source_file": "drivers/lego/sensors/other_sensor_defs.c", - "source_line": 140, - "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" - }, - { - "id": "MS_TOUCH_SENSOR_MUX", - "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 ", - "scale": "ms_touch_mux_scale", - "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", - "source_file": "drivers/lego/sensors/nxt_analog_sensor_defs.c", - "source_line": 117, - "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/breadcrumbs.html b/_includes/breadcrumbs.html deleted file mode 100644 index ea72aad35..000000000 --- a/_includes/breadcrumbs.html +++ /dev/null @@ -1,10 +0,0 @@ -{% assign parent_dirs=page.url | replace_first: '/', '' | split: '/' %} -{% assign link='/' %} -{% for dir in parent_dirs %} - {% if forloop.last %} - {{ dir }} - {% else %} - {% assign link=link | append: dir | append: '/' %} - {{ dir }} > - {% endif %} -{% endfor %} \ No newline at end of file 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 624a9b7d8..000000000 --- a/_includes/footer.html +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/_includes/head.html b/_includes/head.html deleted file mode 100644 index 4fb2f86a1..000000000 --- a/_includes/head.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - {{ page.title }} - - - - - - - - - - - - - - - - - - diff --git a/_includes/header.html b/_includes/header.html deleted file mode 100644 index 37707e95b..000000000 --- a/_includes/header.html +++ /dev/null @@ -1,75 +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/port.md b/_includes/port.md deleted file mode 100644 index 7f3599584..000000000 --- a/_includes/port.md +++ /dev/null @@ -1,135 +0,0 @@ -{% assign port=site.data.ports[page.port_index] %} -{% assign footnotes='' %} -{% if port.notes %} - {% assign footnotes=footnotes | append: port.notes %} -{% endif %} - - - -### General Info - - - - - - - - - - - {%if port.vendor_website %} - - - {% assign split_website=port.vendor_website | split: '/' %} - - - {% endif %} - {% if port.default_address %} - - - - - {% endif %} - - - - - {% if port.vendor_id %} - - - - - {% endif %} - {% if port.product_id %} - - - - - {% endif %} - {%if port.device_class == null %} - - - - - {% endif %} -
device_name{{ port.name }}
- port_name - prefix[^port-name-prefix] - {{ port.prefix }}
Website[{{ split_website[2] }}]({{ port.vendor_website }})
Address - {{ port.default_address }}{{ port.default_address_footnote }} -
sysfs class - {%if port.device_class %} - {{ port.device_class }}{{ port.device_class_footnote }} -
vendor_id - {{ port.vendor_id }}{{ port.vendor_id_footnote }} -
product_id - {{ port.product_id }}{{ port.product_id_footnote }} -
# Modes{{ port.num_modes }}
- -{%if port.device_class == null %} -### Modes - - - - - - - {% for mode in port.mode_info %} - {% if mode.notes %} - {% assign footnotes=footnotes | append: mode.notes %} - {% endif %} - - - - - {% endfor %} -
modeDescription
- {{ mode.name }}{{ mode.name_footnote }},[^not-read-only] - {{ mode.description }}
-{% endif %} - -### Notes - -{{ footnotes }} - -[^port-name-prefix]: The full `port_name` is in the formt: - - [:] - - For example, if we are looking a port 1 of a sensor mux plugged into port 2 - on the EV3, the port name might be `in2:mux1`. - -[lego-port]: ../../drivers/lego-port-class \ 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 cd79f4563..000000000 --- a/_includes/sensor-connection.html +++ /dev/null @@ -1,38 +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" %} - {% if sensor.name == 'mi-xg1300l' %} - {% assign autodetect = "N[^mi-xg1300l]" %} - {% else %} - {% assign autodetect = "Y" %} - {% endif %} -{% when 'wedo-hub-sensor' %} - {% assign connection = "USB" %} - {% assign autodetect = "Y" %} - {% assign sensor.sensor_type = "wedo" %} -{% when 'wedo-sensor' %} - {% assign connection = "Analog/WeDo" %} - {% 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 'ev3-uart-sensor' %} - {% 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 48d04846c..000000000 --- a/_includes/sensor.md +++ /dev/null @@ -1,214 +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 %} -
device_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 }}{{ sensor.vendor_id_footnote }} -
product_id - {{ sensor.product_id }}{{ sensor.product_id_footnote }} -
# Modes{{ sensor.num_modes }}
- -{%if sensor.device_class == null %} -### Modes - - - - - - - - - - - {% for mode in sensor.mode_info %} - {% if mode.notes %} - {% assign footnotes=footnotes | append: mode.notes %} - {% endif %} - - - - - - - - - {% endfor %} -
modeDescriptionunitsdecimals[^decimals]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 %}{{ mode.units_footnote }} - - - {% if mode.decimals %} - {{ mode.decimals }} - {% else %} - 0 - {% endif %} - - - - {% assign num_values=1 %} - {% if mode.data_sets %} - {% assign num_values=mode.data_sets %} - {% endif %} - {{ num_values }} - - - {% for i in (1..num_values) %} - {% assign value=forloop.index0 | prepend: 'value' %} - {% if mode[value] %} - {% if i > 1 %} -
- {% endif %} - {% assign value_footnote=value | append: '_footnote' %} - - {{ value }}: {{ mode[value] }}{{ mode[value_footnote] }} - - {% endif %} - {% endfor %} -
- -[^decimals]: Decimal places. For example, if the range of a value is from 0 to 1000 - and `decimals` 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 %} - -### Commands -{% assign num_commands = sensor.num_commands | plus: 0 %} -{% if num_commands > 0 %} - - - - - - {% for command in sensor.cmd_info %} - {% if command.notes %} - {% assign footnotes=footnotes | append: command.notes %} - {% endif %} - - - - - {% endfor %} -
commandDescription
- {{ command.name }}{{ command.name_footnote }} - {{ command.description }}
-{% else %} -This sensor does not support commands. -{% endif %} - -### Notes - -{{ footnotes }} - -[lego-sensor]: ../../drivers/lego-sensor-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/tabs.html b/_includes/tabs.html deleted file mode 100644 index e04d5cb4c..000000000 --- a/_includes/tabs.html +++ /dev/null @@ -1,48 +0,0 @@ -{% comment %} - -This uses `/javascripts/tabs.js` and css to provide a tabbed interface to hide -and reveal content using tabs. Useful for things like code samples in multiple -languages or tutorials for multiple OSes. - -Parameters: - -id: Can be anything. -tabs: The labels that will be displayed on the tabs separated with a "|" character. -files: The names of the files that will be used for the contents of the tabs - separated with a "|" character. These can be .html or .md files. The files - must be placed in the same directory as the calling file in a subdirectory - named `_tabs/`. - -{% endcomment %} - -
-{% assign id = "0" %} -
-
    - {% assign tabs = include.tabs | split: "|" %} - {% for tab in tabs %} -
  • - {{ tab }} -
  • - {% endfor %} -
-
-
- {% assign tab_files = include.files | split: "|" %} - {% for tab in tab_files %} - {% assign ext = tab | split: "." | last %} - {% if ext == "md" %} - {% assign markdown = "markdown='1'" %} - {% else %} - {% assign markdown = "" %} - {% endif %} -{% comment %} Since we can have markdown here, it is important that these lines are not indented {% endcomment %} -
- -{% include_relative _tabs/{{ tab }} %} - -
-{% comment %} End markdown no-indent block {% endcomment %} - {% endfor %} -
-
diff --git a/_includes/title.html b/_includes/title.html deleted file mode 100644 index 5cf52dcb4..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 64d30d53d..9fcd12888 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -2,24 +2,26 @@ layout: page --- -{% 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 %} -{% else %} - {% assign edit_path = site.github.repository_url | append: '/edit/master/' | append: page.path %} -{% endif %} - -