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 355960e

Browse files
Update arduino-to-node.ino
1 parent 5e74776 commit 355960e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎arduino-to-node.ino

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
int percent = 0;int prevPercent = 0;void setup() { Serial.begin( 9600 ); }void loop() { percent = round(analogRead(0) / 1024.00 * 100); if(percent != prevPercent) { Serial.println(percent); prevPercent = percent; } delay(100); }
1+
int percent = 0;
2+
int prevPercent = 0;
3+
4+
void setup() {
5+
6+
Serial.begin( 9600 );
7+
8+
}
9+
10+
void loop() {
11+
12+
percent = round(analogRead(0) / 1024.00 * 100);
13+
14+
if(percent != prevPercent) {
15+
16+
Serial.println(percent);
17+
prevPercent = percent;
18+
19+
}
20+
21+
delay(100);
22+
23+
}

0 commit comments

Comments
(0)

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