]> git.piffa.net Git - sketchbook_andrea/blobdiff - RGB_LED/rgb_3_ReadASCIIString/rgb_3_ReadASCIIString.ino
Servo commenti
[sketchbook_andrea] / RGB_LED / rgb_3_ReadASCIIString / rgb_3_ReadASCIIString.ino
index 9da6b1e1e2d0febf7f58a894c9ab106e406adbb2..13cf2b850df49ff712ccfb5b2ddf2686478b0b0a 100644 (file)
@@ -1,26 +1,41 @@
 /*
   Reading a serial ASCII-encoded string.
 /*
   Reading a serial ASCII-encoded string.
+  
+  Beware: set monitor to NL NewLine only
  
  This sketch demonstrates the Serial parseInt() function.
  It looks for an ASCII string of comma-separated values.
  It parses them into ints, and uses those to fade an RGB LED.
  
  
  This sketch demonstrates the Serial parseInt() function.
  It looks for an ASCII string of comma-separated values.
  It parses them into ints, and uses those to fade an RGB LED.
  
- Circuit: Common-anode RGB LED wired like so:
- * Red cathode: digital pin 3
- * Green cathode: digital pin 5
- * blue cathode: digital pin 6
- * anode: +5V
+
+ Once you have programmed the Arduino, open your Serial minitor. 
+ Make sure you have chosen to send a newline character when sending a message. 
+ Enter values between 0-255 for the lights in the following format : 
+ Red,Green,Blue. 
+
+ Seriously: did you set the Newline setting in the monitor?
+
+ Once you have sent the values to the Arduino, 
+ the attached LED will turn the color you specified, 
+ and you will receive the HEX values in the serial monitor. 
  
  created 13 Apr 2012
  by Tom Igoe
  
  This example code is in the public domain.
  
  created 13 Apr 2012
  by Tom Igoe
  
  This example code is in the public domain.
+
+
+
+  Schema: http://lab.piffa.net/schemi/rgb.jpg
+
  */
 
 // pins for the LEDs:
  */
 
 // pins for the LEDs:
-const int redPin = 3;
-const int greenPin = 5;
-const int bluePin = 6;
+const int redPin = 11;
+const int greenPin = 10;
+const int bluePin = 9;
 
 void setup() {
   // initialize serial:
 
 void setup() {
   // initialize serial: