Skip to content
Snippets Groups Projects
Commit 1a37adb6 authored by Quentin Bolsee's avatar Quentin Bolsee
Browse files

improved comments

parent ad1067e3
Branches
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// serial servo PWM // serial servo PWM
// //
// Neil Gershenfeld 7/28/21 // Neil Gershenfeld 7/28/21
// Quentin Bolsee 7/12/2021 : add button // Quentin Bolsee 12/7/21 : add button
// //
// This work may be reproduced, modified, distributed, // This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose, but must // performed, and displayed for any purpose, but must
...@@ -34,6 +34,7 @@ void loop() { ...@@ -34,6 +34,7 @@ void loop() {
if (SerialUSB.available()) { if (SerialUSB.available()) {
SerialUSB.readBytes((char *)&duration,2); SerialUSB.readBytes((char *)&duration,2);
if (duration == 65535L) { if (duration == 65535L) {
// special command, reply with button value
int btn = digitalRead(BUTTON); int btn = digitalRead(BUTTON);
SerialUSB.write(btn ? '1' : '0'); SerialUSB.write(btn ? '1' : '0');
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// serial step-and-direction // serial step-and-direction
// //
// Neil Gershenfeld 4/11/21 // Neil Gershenfeld 4/11/21
// Quentin Bolsee 7/12/2021 : add button // Quentin Bolsee 12/7/21 : add button
// //
// This work may be reproduced, modified, distributed, // This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose, but must // performed, and displayed for any purpose, but must
...@@ -82,6 +82,7 @@ void loop() { ...@@ -82,6 +82,7 @@ void loop() {
digitalWrite(STEP,LOW); digitalWrite(STEP,LOW);
} }
else if (c == '?') { else if (c == '?') {
// reply with button value
int btn = digitalRead(BUTTON); int btn = digitalRead(BUTTON);
SerialUSB.write(btn ? '1' : '0'); SerialUSB.write(btn ? '1' : '0');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment