Skip to content
Browse files

Edited some comments to handle long lines in manuscript-ejg

  • Loading branch information...
1 parent 4b707b5 commit 8f2b8fdd1f5017197c538e32a8022f82883b4836 @ejgertz committed Dec 9, 2011
Showing with 12 additions and 11 deletions.
  1. +12 −11 chapter-2/NoiseMonitor
View
23 chapter-2/NoiseMonitor
@@ -18,14 +18,15 @@ int counter =0;
int threshold[] = { 0, 47, 99, 159, 227, 308, 407, 535, 715, 800, 900};
-// You can play with the sensitivity of the LEDs by removing the above threshold and using
-// the one below. Try different values. Experiment!
+// You can play with the sensitivity of the LEDs by removing the above threshold
+// and using the one below. Try different values. Experiment!
//int threshold[]={ 0, 25, 50, 75, 100, 125, 150, 175, 200, 225};
void setup()
{
- // declare the ledPins as an OUTPUT. We're doing it line-by-line, so you can see what's happening.
+ // declare the ledPins as an OUTPUT.
+ // We're doing it line-by-line, so you can see what's happening.
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
@@ -63,8 +64,10 @@ void setup()
}
- // Tests the LEDs by turning them on. This time, we're using a for() loop to do the job.
- // Using for(), while() and other loops is probably how you should handle tasks like this.
+ // Tests the LEDs by turning them on.
+ // This time, we're using a for() loop to do the job.
+ // Using for(), while() and other loops is probably
+ // how you should handle tasks like this.
for(int i=0; i <=numberOfLEDs; i++)
{
digitalWrite(i+1, HIGH);
@@ -94,9 +97,9 @@ void loop()
// adding that to the running total, and taking the average.
// This gives us a "typical" sound sample.
- // Here we increase our counter, to keep track of how many audio samples
- // we are taking. If we use more than the number of samples,
- // use the % (modulo) operator to set the counter to zero.
+ // Here we increase our counter, to keep track of how many
+ // audio samples we're taking. If we use more than the number
+ // of samples, use the % (modulo) operator to set the counter to zero.
counter = ++counter % numberOfSamples;
@@ -138,6 +141,4 @@ void loop()
{
digitalWrite(i+1, LOW);
}
-}
-
-
+}

0 comments on commit 8f2b8fd

Please sign in to comment.
Something went wrong with that request. Please try again.