Added new getting started guide for node js#357
Added new getting started guide for node js#357liam-b wants to merge 4 commits intoev3dev:masterfrom liam-b:patch-2
Conversation
|
|
| --- | ||
|
|
||
| {% include /style/icon.html type="warning" %} | ||
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. |
| --- | ||
|
|
||
| {% include /style/icon.html type="warning" %} | ||
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. |
There was a problem hiding this comment.
"really" sounds mildly unprofessional in this context. Can we use another word there?
| --- | ||
|
|
||
| {% include /style/icon.html type="warning" %} | ||
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. |
| --- | ||
|
|
||
| {% include /style/icon.html type="warning" %} | ||
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. |
There was a problem hiding this comment.
It's also limited to an equivalently old Node.js version, which should also be mentioned.
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. | ||
| {: .alert .alert-warning} | ||
|
|
||
| **Before you start, make sure that you have configured a network connection to |
There was a problem hiding this comment.
Can you link to the tutorials that we have for these tasks?
| sensor.mode = 'NEW-MODE'; // where 'NEW-MODE' can be replaced by any valid mode | ||
| ``` | ||
|
|
||
| And then using `sensor.someValueAcessor` will return the sensor value, where `someValueAcessor` can be replaced by any valid accessor (also found on the [default supported sensors](http://wasabifan.github.io/ev3dev-lang-js/modules/_sensors_.html) list by clicking on the sensor you are using) |
| And then using `sensor.someValueAcessor` will return the sensor value, where `someValueAcessor` can be replaced by any valid accessor (also found on the [default supported sensors](http://wasabifan.github.io/ev3dev-lang-js/modules/_sensors_.html) list by clicking on the sensor you are using) | ||
|
|
||
| ## Next steps | ||
| So that's the basic overview of how to use node with ev3dev! For info on all supported sensors, motors and other documentation visit the [github page](https://github.com/wasabifan/ev3dev-lang-js) and the [documentation page](http://wasabifan.github.io/ev3dev-lang-js). |
| ## Next steps | ||
| So that's the basic overview of how to use node with ev3dev! For info on all supported sensors, motors and other documentation visit the [github page](https://github.com/wasabifan/ev3dev-lang-js) and the [documentation page](http://wasabifan.github.io/ev3dev-lang-js). | ||
|
|
||
| The documentation page looks a bit confusing, but what you really need to worry about are the names of the classes and the **methods** / **accessors**. (eg. the large motor has **methods** such as: `runForever()`, `runForTime()` etc and the color sensor has **accessors** such as: `reflectedLightIntensity`, `ambientLightIntensity` etc) |
There was a problem hiding this comment.
ambientLightIntensityetc
should be
ambientLightIntensity, etc.
|
|
||
| The documentation page looks a bit confusing, but what you really need to worry about are the names of the classes and the **methods** / **accessors**. (eg. the large motor has **methods** such as: `runForever()`, `runForTime()` etc and the color sensor has **accessors** such as: `reflectedLightIntensity`, `ambientLightIntensity` etc) | ||
|
|
||
| The [sensor list](http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-jessie/sensor_data.html) and the [motor list](http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-jessie/motor_data.html) are both really useful pages aswell. |
|
|
||
| The documentation page looks a bit confusing, but what you really need to worry about are the names of the classes and the **methods** / **accessors**. (eg. the large motor has **methods** such as: `runForever()`, `runForTime()` etc and the color sensor has **accessors** such as: `reflectedLightIntensity`, `ambientLightIntensity` etc) | ||
|
|
||
| The [sensor list](http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-jessie/sensor_data.html) and the [motor list](http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-jessie/motor_data.html) are both really useful pages aswell. |
|
Hey! Yeah, I'm not the greatest at writing documentation :). Thanks for editing it though! I added 'getting started guides' to the description of that category and went through and fixed what you pointed out (I haven't committed some things yet). Just a quick question, what other versions are npm limited to? Because it's 0.10.29 on my brick. Thanks, |
No problem! It's always easier to spot issues as a reviewer than as the original author... You grow blind out of familiarity.
npm may be at that version -- I've never actually checked; my comment was that Node.js itself is stuck on 0.10 or 0.12 (I can't remember exactly) and support has essentially been dropped for the EV3's processor since. When you said "npm" did you mean "node"? |
|
|
||
| {% include /style/icon.html type="warning" %} | ||
| Note that Node JS run really slowly on the EV3 brick and is limited to NPM version 0.10.29 which can be a problem when trying to install some libraries. | ||
| Note that Node.js runs frustratingly slowly on the EV3 brick and is limited to an old version of both Node.js and npm. You may want to consider using Python or another ev3dev-supported language instead. |
There was a problem hiding this comment.
It looks like non-EV3 stretch images are going to have node 4.7.2
| - id: software-languages | ||
| title: Programming Languages and Tooling | ||
| description: "Configuring a development environment, installing new languages, and using advanced language tools." | ||
| description: "Configuring a development environment, installing new languages, using advanced language tools and getting started guides for languages." |
There was a problem hiding this comment.
It might be better to put "getting started" first in the list.
|
|
||
| <p class="lead"> | ||
| Node.js is a framework that allows you to run JavaScript as a local application. It is designed to make building servers and other asynchronous apps as easy as possible. In this tutorial, we'll show you how to get up-and-running with Node.js on ev3dev. | ||
| </p> |
There was a problem hiding this comment.
Just do {: .lead} at the end here. Kramdown automatically creates the paragraph element.
| To start, navigate to a project directory (e.g `~/src/js`) that we can store our files in: | ||
|
|
||
| ```shell | ||
| mkdir -p ~/src/js && cd ~/src/js |
There was a problem hiding this comment.
This might be better as 2 separate lines instead of &&
| ```javascript | ||
| var ev3dev = require('ev3dev-lang'); | ||
|
|
||
| var motor = new ev3dev.Motor('outA'); // create new motor plugged into port A called 'motor' |
There was a problem hiding this comment.
Might want a link to http://www.ev3dev.org/docs/platform-comparison/ here to get the port names for non-EV3 hardware.
No description provided.