aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-03-04 23:16:53 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-03-04 23:16:53 -0500
commit12277ce5ac4a81a1f42b7fd695dafbf195c6f8e3 (patch)
tree05a393f80251cc7f483a6815d821878019874091 /docs
parent02e76ec27b5737bce836a5460427b538076f01ef (diff)
downloadlibrambutan-12277ce5ac4a81a1f42b7fd695dafbf195c6f8e3.tar.gz
librambutan-12277ce5ac4a81a1f42b7fd695dafbf195c6f8e3.zip
USBSerial docs fix.
Diffstat (limited to 'docs')
-rw-r--r--docs/source/lang/api/serialusb.rst22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/source/lang/api/serialusb.rst b/docs/source/lang/api/serialusb.rst
index 87fa641..4ddfa4a 100644
--- a/docs/source/lang/api/serialusb.rst
+++ b/docs/source/lang/api/serialusb.rst
@@ -224,7 +224,7 @@ running from battery, or connected but not monitored. You may need to
experiment with the DTR/RTS logic for your platform and device
configuration. ::
- #define LED_PIN 13
+ #define LED_PIN BOARD_LED_PIN
void setup() {
/* Set up the LED to blink */
@@ -232,22 +232,22 @@ configuration. ::
}
void loop() {
- // LED will stay off if we are disconnected;
- // will blink quickly if USB is unplugged (battery etc)
+ // LED will stay off if we are disconnected, and will blink
+ // quickly if USB is unplugged (battery power, etc.).
if(SerialUSB.isConnected()) {
digitalWrite(LED_PIN, 1);
}
delay(100);
- // If this logic fails to detect if bytes are going to
- // be read by the USB host, then the println() will fully
- // many times, causing a very slow LED blink.
- // If the characters are printed and read, the blink will
- // only slow a small amount when "really" connected, and fast
- // when the virtual port is only configured.
+ // If this logic fails to detect if bytes are going to be read
+ // by the USB host, then the println() take a long time,
+ // causing a very slow LED blink. If the characters are
+ // printed and read, the blink will only slow a small amount
+ // when "really" connected, and will be fast fast when the
+ // virtual port is only configured.
if(SerialUSB.isConnected() && (SerialUSB.getDTR() || SerialUSB.getRTS())) {
- for(int i=0; i<10; i++) {
- SerialUSB.println(123456,BIN);
+ for(int i = 0; i < 10; i++) {
+ SerialUSB.println(123456, BIN);
}
}
digitalWrite(LED_PIN, 0);