Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new getting started guide for node js #357

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Added new getting started guide for node js #357

wants to merge 4 commits into from

Conversation

liam-b
Copy link

@liam-b liam-b commented Mar 24, 2017

No description provided.

@WasabiFan
Copy link
Member

WasabiFan commented Mar 25, 2017

Sorry about the Travis CI server error; it's currently having some issues. Your page doesn't have any errors. I convinced it to be less angry. The status is green!

Copy link
Member

@WasabiFan WasabiFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this up! It looks great; I added a fair number of nit-picking comments because I'm a perfectionist 😉

Can you update the description here to include "getting started guides" for this catagory?

---

{% 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run -> runs

---

{% 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPM is npm

---

{% 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessor (two Cs)

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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "So"

## 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ambientLightIntensity etc

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really -> extremely


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aswell -> as well

@WasabiFan WasabiFan requested a review from dlech March 25, 2017 00:27
@liam-b
Copy link
Author

liam-b commented Mar 25, 2017

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,
Liam

@WasabiFan
Copy link
Member

WasabiFan commented Mar 25, 2017

Yeah, I'm not the greatest at writing documentation :).

No problem! It's always easier to spot issues as a reviewer than as the original author... You grow blind out of familiarity.

Just a quick question, what other versions are npm limited to? Because it's 0.10.29 on my brick.

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"?

@WasabiFan
Copy link
Member

I added my suggested changes to this PR; @liam-b if you disagree with any of them, feel free to edit it back or ask!

@dlech can you take a quick pass over this?

@@ -5,74 +5,70 @@ author: "@liam-b"
---

{% 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like non-EV3 stretch images are going to have node 4.7.2

@@ -9,7 +9,7 @@
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."
description: "Configuring a development environment, installing new languages, using advanced language tools and getting started guides for languages."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want a link to http://www.ev3dev.org/docs/platform-comparison/ here to get the port names for non-EV3 hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants