Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 04371f4

Browse files
Update README.md
1 parent 1f3ab1c commit 04371f4

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

‎README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ The above code creates a webpage with two buttons. When the buttons are clicked
4646

4747
Before we setup the Node.js server we need to know the name of the serialport your Arduino is attached to. You can find the name of your serialport, it will look something like `/dev/tty.wchusbserialfa1410`. On a Mac using the Terminal and entering the following command:
4848

49-
```
49+
```sh
5050
ls /dev/{tty,cu}.*
5151
```
5252

5353
On a PC you can use the command line and the following command:
5454

55-
```
55+
```sh
5656
chgport
5757
```
5858

59-
On my PC when I use the `chgport` command I get the following output:
59+
On a Windows machine the `chgport` command would result in the following:
6060

61-
```
61+
```sh
6262
AUX = \DosDevices\COM1
6363
COM1 = \Device\Serial0
6464
COM3 = \Device\Serial2
6565
```
6666

67-
In my Node.js I would use just `COM3` as my serialport string.
67+
My Node.js will require the use of `COM3` as the serialport string.
6868

6969
If you're not sure which one is your Arduino, just disconnet your Arduino and execute the cpommand again and take note of which port is no longer on the list.
7070

@@ -117,13 +117,15 @@ app.listen(3000);
117117

118118
The above code uses Socket.io to listen for a message from the HTML/JavaScript webpage and then simply passes on the message to the connected Arduino.
119119

120-
> Note: Make sure to change the name of the serialport.
120+
> **Note**
121+
>
122+
> Make sure to change the name of the serialport.
121123
122124
## The Arduino
123125

124126
Using [Arduino Create](https://create.arduino.cc/editor) create the following sketch and upload it to your Arduino.
125127

126-
```csharp
128+
```cpp
127129
int lightPin = 2;
128130

129131
void setup()
@@ -156,13 +158,13 @@ void loop() {
156158

157159
The previous code will listen to the serialport for an incoming message. Once a message is received, if the message is a one the light will turn on, if the message is a zero the light will turn off.
158160

159-
[View the Arduino code on Arduino Create](https://create.arduino.cc/editor/professoradam/af5288bf-00cc-406c-844e-f20485fa2df8/preview)
161+
> [View the Arduino code on Arduino Create](https://create.arduino.cc/editor/professoradam/af5288bf-00cc-406c-844e-f20485fa2df8/preview)
160162
161163
You will need to setup the following circuit using your Arduino:
162164

163165
![Tinkercad Circuit](https://raw.githubusercontent.com/codeadamca/arduino-from-nodejs/master/tinkercad-from-nodejs.png)
164166

165-
[View the Circuit on Tinkercad](https://www.tinkercad.com/things/h0C03Xahv9R)
167+
> [View the Circuit on Tinkercad](https://www.tinkercad.com/things/h0C03Xahv9R)
166168
167169
## Launch Application
168170

@@ -171,9 +173,11 @@ You will need to setup the following circuit using your Arduino:
171173
3. Open up a browser and enter the URL `http://localhost:3000/`.
172174
4. Using your browser push the on and off buttons and watch your Arduino for a changing light.
173175

174-
## Tutorial Requirements:
176+
***
177+
178+
## Repository Resources
175179

176-
* [Visual Studio Code](https://code.visualstudio.com/) or [Brackets](http://brackets.io/)(or any code editor)
180+
* [Visual Studio Code](https://code.visualstudio.com/) (or any code editor)
177181
* [Arduino Create](https://create.arduino.cc/editor)
178182
* [SerialPort NPM](https://www.npmjs.com/package/serialport)
179183
* [Socket.io](https://socket.io/)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /