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 a6fb674

Browse files
Added a title to the HTML file
1 parent f96f5df commit a6fb674

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

‎app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const parser = new parsers.Readline({
99
delimiter: '\r\n'
1010
});
1111

12-
var port = new SerialPort('/dev/tty.usbmodem1421',{
12+
var port = new SerialPort('/dev/tty.wchusbserialfa1410',{
1313
baudRate: 9600,
1414
dataBits: 8,
1515
parity: 'none',
@@ -40,4 +40,4 @@ parser.on('data', function(data) {
4040

4141
});
4242

43-
app.listen(3000);
43+
app.listen(3000);

‎index.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@
33
<head>
44

55
<script src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js'></script>
6-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
76

87
<script>
98

10-
$(document).ready(function(){
11-
12-
var socket = io();
9+
var socket = io();
1310

14-
socket.on('data', function(data) {
15-
16-
console.log(data);
17-
18-
$('#sample').css('opacity',data/100);
19-
20-
});
11+
socket.on('data', function(data) {
12+
13+
console.log(data);
2114

15+
document.getElementById('sample').style.opacity = data/100+"%";
16+
2217
});
2318

2419
</script>
@@ -36,7 +31,9 @@
3631
</head>
3732
<body>
3833

34+
<h1>Communicating from an Arduino to Node.js</h1>
35+
3936
<div id="sample"></div>
4037

4138
</body>
42-
</html>
39+
</html>

0 commit comments

Comments
(0)

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