Tutorial.ReadASCIIString History

Hide minor edits - Show changes to markup

August 28, 2015, at 10:50 AM by Simone Maiocchi -
Changed lines 1-6 from:
to:
Added line 21:
Changed line 27 from:
to:
Changed line 29 from:
to:
Changed lines 46-47 from:
to:
Added line 126:
Changed lines 128-129 from:
to:
Changed lines 136-146 from:
  • Serial Call and Response ASCII - Sending multiple vairables using a call-and-response (handshaking) method, and ASCII-encoding the values before sending.
to:
  • ASCIITable - Demonstrates Arduino's advanced serial output functions.
  • Dimmer - Move the mouse to change the brightness of an LED.
  • Graph - Send data to the computer and graph it in Processing.
  • Midi - Send MIDI note messages serially.
  • MultiSerialMega - Use two of the serial ports available on the Arduino and Genuino Mega.
  • PhysicalPixel - Turn a LED on and off by sending data to your board from Processing or Max/MSP.
  • SerialCallResponse - Send multiple variables using a call-and-response (handshaking) method.
  • SerialCallResponseASCII - Send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.
  • SerialEvent - Demonstrates the use of SerialEvent().
  • VirtualColorMixer - Send multiple variables from Arduino to your computer and read them in Processing or Max/MSP.
July 29, 2015, at 10:50 PM by Simone Maiocchi -
Changed lines 125-128 from:
  • Serial Call and Response ASCII - Sending multiple vairables using a call-and-response (handshaking) method, and ASCII-encoding the values before sending.
to:
  • Serial Call and Response ASCII - Sending multiple vairables using a call-and-response (handshaking) method, and ASCII-encoding the values before sending.


Last revision 2015/07/29 by SM

July 29, 2015, at 10:47 PM by Simone Maiocchi -
Changed lines 29-32 from:

You'll need five wires to make the circuit above. Connect a red wire to one of the long vertical rows on your breadboard. Connect the other end to the 5V pin on your Arduino.

Place an RGB LED on your breadboard. Check the datasheet for your specific LED to verify the pins. Connect the power rail you just created to the common anode on the LED.

to:

You'll need four wires to make the circuit above. A wire connects the 5V from the POWER connector of the board to the longest pin of the RGB LED. You should turn the LED so that the longest pin is the second from the left..

Place the RGB LED on your breadboard with the longest pin as the second from the top. Check the datasheet for your specific LED to verify the pins, but they should be R, V+, G and B. The wire from 5V should therefore connect that second pin from top, as in the connection scheme above.

Changed lines 35-37 from:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness. Essentially, instead of using analogWrite(pin, brightness), you'll be calling analogWrite(pin, 255-brightness).

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the sketch side, so you can send values which correspond to the expected brightness. Essentially, instead of using analogWrite(pin, brightness), you'll be calling analogWrite(pin, 255-brightness).

Changed lines 114-115 from:

Once you have programmed the board, open your Arduino IDE 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. Once you have sent the values to the Arduino, the attached LED will turn into the color you specified and you will receive the HEX values in the serial monitor.

to:

Once you have programmed the board, open your Arduino Software (IDE) serial monitor. 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. Once you have sent the values to the board, the attached LED will turn into the color you specified and you will receive back the HEX values in the serial monitor.

Changed lines 121-124 from:
to:
July 29, 2015, at 10:36 PM by Simone Maiocchi -
Changed lines 9-10 from:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values or CSV), but other characters like a space or a period will work too. The values are parsed into integers and used to determine the color of a RGB LED. You'll use the Arduino IDE serial monitor to send strings like "5,220,70" to the board to change the light color.

to:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values or CSV), but other characters like a space or a period will work too. The values are parsed into integers and used to determine the color of a RGB LED. You'll use the Arduino Software (IDE) serial monitor to send strings like "5,220,70" to the board to change the light color.

Changed lines 20-21 from:
to:
Added lines 24-28:

Schematic

click the image to enlarge

July 09, 2015, at 03:53 PM by Simone Maiocchi -
Changed lines 9-10 from:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values or CSV), but other characters like a space or a period will work too. The values are parsed into integers and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the light color.

to:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values or CSV), but other characters like a space or a period will work too. The values are parsed into integers and used to determine the color of a RGB LED. You'll use the Arduino IDE serial monitor to send strings like "5,220,70" to the board to change the light color.

July 09, 2015, at 03:52 PM by Simone Maiocchi -
Added lines 13-14:
  • common anode RGB LED
  • 3 220 ohm resistors
Changed lines 17-19 from:
  • common anode RGB LED
  • 3 220 ohm resistors
to:
July 09, 2015, at 03:51 PM by Simone Maiocchi -
Changed lines 7-8 from:

Read ASCII String

to:

Read ASCII String

Changed line 11 from:

Hardware Required

to:

Hardware Required

Changed lines 18-19 from:

Circuit

to:

Circuit

Changed lines 33-34 from:

Code

to:

Code

Changed lines 114-115 from:

See Also:

to:

See Also:

July 09, 2015, at 03:49 PM by Simone Maiocchi -
Changed lines 9-10 from:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values), but other characters like a space or a period will work too. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the light color.

to:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values or CSV), but other characters like a space or a period will work too. The values are parsed into integers and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the light color.

Changed lines 77-78 from:

Using constrain(), you can keep the values in an acceptable range for PWM control. This way, if the value was outside the range of what PWM can send, it will be limited to a valid number. By subtracting this value from 255 you will be formatting the value to use with a common anode LED. As explained above, these LEDs will illuminate when there is a voltage difference between the anode and the pin connected to the Arduino:

to:

Using constrain(), you can keep the values in an acceptable range for PWM control. This way, if the value was outside the range of what PWM can send, it will be limited to a valid number. By subtracting this value from 255 you will be formatting the value to use with a common anode LED. As explained above, these LEDs will illuminate when there is a voltage difference between the anode and the pin connected to the board:

Changed lines 109-110 from:

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. 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.

to:

Once you have programmed the board, open your Arduino IDE 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. Once you have sent the values to the Arduino, the attached LED will turn into the color you specified and you will receive the HEX values in the serial monitor.

July 09, 2015, at 03:46 PM by Simone Maiocchi -
Changed lines 18-19 from:

Circuit

to:

Circuit

Changed lines 33-34 from:

Code

to:

Code

Changed lines 114-120 from:

See Also:

to:

See Also:

July 09, 2015, at 03:43 PM by Simone Maiocchi -
Changed lines 1-2 from:

Examples > Communication

to:
Changed lines 9-17 from:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values), but other characters like a space or a period will work too. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the lights.

Hardware Required

  • Arduino Board
  • Breadboard
  • Hookup wire
  • Common anode RGB LED
  • Three 220-ohm resistors
to:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values), but other characters like a space or a period will work too. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the light color.

Hardware Required

  • Arduino or Genuino Board
  • hook-up wires
  • breadboard
  • common anode RGB LED
  • 3 220 ohm resistors
Changed line 37 from:
to:

[@

Changed lines 41-47 from:
to:

@]

In your setup(), begin serial communication at 9600 bits of data per second between the board and your computer with the line:

Serial.begin(9600);

Changed lines 51-52 from:
to:

[@

Changed lines 55-56 from:
to:

@]

Changed lines 59-61 from:
to:
while (Serial.available() > 0) {
Changed lines 65-66 from:
to:

[@

Changed lines 69-70 from:
to:

@]

Changed lines 73-75 from:
to:
 if (Serial.read() == '\n') {
Changed lines 79-80 from:
to:

[@

Changed lines 83-84 from:
to:

@]

Changed lines 87-88 from:
to:

[@

Changed lines 91-92 from:
to:

@]

Changed lines 95-96 from:
to:

[@

Changed lines 99-100 from:
to:

@]

Changed lines 103-104 from:
to:

[@

Changed lines 107-108 from:
to:

@]

April 03, 2015, at 11:59 AM by Arturo -
Changed line 33 from:

[@

to:
Changed lines 37-38 from:

@]

to:
Changed lines 41-42 from:

Serial.begin(9600);

to:
Changed lines 46-47 from:

[@

to:
Changed lines 51-52 from:

@]

to:
Changed lines 55-56 from:

while (Serial.available() > 0) {

to:
Changed lines 60-61 from:

[@

to:
Changed lines 65-66 from:

@]

to:
Changed lines 69-70 from:

if (Serial.read() == '\n') {

to:
Changed lines 74-75 from:

[@

to:
Changed lines 79-80 from:

@]

to:
Changed lines 83-84 from:

[@

to:
Changed lines 88-89 from:

@]

to:
Changed lines 92-93 from:

[@

to:
Changed lines 97-98 from:

@]

to:
Changed lines 101-102 from:

[@

to:
Changed lines 106-107 from:

@]

to:
September 04, 2013, at 11:28 AM by Roberto Guido - corrections on example code syntax. Thanks Peter H for alert
Changed lines 33-36 from:

const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;

to:
const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;
Changed lines 45-48 from:

pinMode(redPin, OUTPUT);\\ pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

to:
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
Changed lines 57-60 from:

int red = Serial.parseInt();\\ int green = Serial.parseInt();
int blue = Serial.parseInt();

to:
int red = Serial.parseInt();
int green = Serial.parseInt();
int blue = Serial.parseInt();
Changed lines 69-72 from:

red = 255 - constrain(red, 0, 255);
green = 255 - constrain(green, 0, 255);
blue = 255 - constrain(blue, 0, 255);

to:
red = 255 - constrain(red, 0, 255);
green = 255 - constrain(green, 0, 255);
blue = 255 - constrain(blue, 0, 255);
Changed lines 77-80 from:

analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);

to:
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
Changed lines 85-88 from:

Serial.print(red, HEX);
Serial.print(green, HEX);
Serial.println(blue, HEX);

to:
Serial.print(red, HEX);
Serial.print(green, HEX);
Serial.println(blue, HEX);
Changed lines 93-96 from:

}
}
}

to:
    }
  }
}
May 02, 2012, at 04:10 PM by Scott Fitzgerald -
Changed lines 87-89 from:
to:
April 17, 2012, at 09:34 PM by Scott Fitzgerald -
Changed lines 26-28 from:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness. Essentially, instead of writing analogWrite(pin, brightness), you'll be writing analogWrite(pin, 255-brightness).

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness. Essentially, instead of using analogWrite(pin, brightness), you'll be calling analogWrite(pin, 255-brightness).

Changed line 92 from:
to:
April 17, 2012, at 09:20 PM by Scott Fitzgerald -
Changed lines 16-17 from:
to:
April 17, 2012, at 09:20 PM by Scott Fitzgerald -
Changed lines 16-17 from:
to:
April 17, 2012, at 09:14 PM by Scott Fitzgerald -
Changed lines 5-6 from:

This sketch uses the Serial.parseInt() function to locate comma separated values. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the lights.

to:

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values), but other characters like a space or a period will work too. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the lights.

Changed lines 26-28 from:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness.

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness. Essentially, instead of writing analogWrite(pin, brightness), you'll be writing analogWrite(pin, 255-brightness).

Changed lines 67-68 from:

Now that you have formatted the values for PWM, use analogWrite() to change the color of the LED:

to:

Now that you have formatted the values for PWM, use analogWrite() to change the color of the LED. Because you subtracted your value from 255 in the step above:

April 17, 2012, at 09:06 PM by Scott Fitzgerald -
Changed lines 12-13 from:
to:
  • Three 220-ohm resistors
Changed lines 22-25 from:

Place an RGB LED on your breadboard. Check the datasheet for your specific LED to verify the pins. Connect the power rail you just created to the common anode on the LED.

With your remaining wires, connect your red cathode to pin 3, green cathode to pin 5, and blue cathode to pin 6.

to:

Place an RGB LED on your breadboard. Check the datasheet for your specific LED to verify the pins. Connect the power rail you just created to the common anode on the LED.

With your remaining wires, connect your red cathode to pin 3, green cathode to pin 5, and blue cathode to pin 6 in series with the resistors.

April 17, 2012, at 08:01 PM by Scott Fitzgerald -
Changed lines 25-27 from:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. If you wanted only red to turn on, you would send "0,255,255". If you only wanted blue, you would send "255,255,0".

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. In the code below, you'll use a little bit of math on the Arduino side, so you can send values which correspond to the expected brightness.

Changed lines 32-36 from:

const int redPin = 3; const int greenPin = 5; const int bluePin = 6;

to:

const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;
In your setup(), begin serial communication at 9600 bits of data per second between Arduino and your computer with the line:

Serial.begin(9600);

Also in the setup, you'll want to configure the pins as outputs:

pinMode(redPin, OUTPUT);\\ pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

In the loop(), check to see if there is any data in the serial buffer. By making this a while() statement, it will run as long as there is information waiting to be read :

while (Serial.available() > 0) {

Next, declare some local variables for storing the serial information. This will be the brightness of the LEDs. Using Serial.parseInt() to separate the data by commas, read the information into your variables:

int red = Serial.parseInt();\\ int green = Serial.parseInt();
int blue = Serial.parseInt();

Once you've read the data into your variables, check for the newline character to proceed:

if (Serial.read() == '\n') {

Using constrain(), you can keep the values in an acceptable range for PWM control. This way, if the value was outside the range of what PWM can send, it will be limited to a valid number. By subtracting this value from 255 you will be formatting the value to use with a common anode LED. As explained above, these LEDs will illuminate when there is a voltage difference between the anode and the pin connected to the Arduino:

red = 255 - constrain(red, 0, 255);
green = 255 - constrain(green, 0, 255);
blue = 255 - constrain(blue, 0, 255);

Now that you have formatted the values for PWM, use analogWrite() to change the color of the LED:

analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);

Send the value of each LED back to the serial monitor in one string as HEX values :

Serial.print(red, HEX);
Serial.print(green, HEX);
Serial.println(blue, HEX);

Finally, close up your brackets from the if statement, while statement, and main loop :

}
}
}

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. 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.

April 17, 2012, at 07:29 PM by Scott Fitzgerald -
Changed lines 32-36 from:

@@const int redPin = 3; const int greenPin = 5; const int bluePin = 6;@@

to:

const int redPin = 3; const int greenPin = 5; const int bluePin = 6;

April 17, 2012, at 07:28 PM by Scott Fitzgerald -
Changed lines 25-27 from:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness.

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness. If you wanted only red to turn on, you would send "0,255,255". If you only wanted blue, you would send "255,255,0".

Changed lines 30-31 from:
to:

You'll first set up some global variables for the pins your LED will connect to. This will make it easier to differentiate which one is red, green, and blue in the main part of your program:

@@const int redPin = 3; const int greenPin = 5; const int bluePin = 6;@@

Changed line 46 from:
  • Serial Call and Response ASCII - sending multiple vairables using a call-and-response (handshaking) method, and ASCII-encoding the values before sending.
to:
  • Serial Call and Response ASCII - sending multiple vairables using a call-and-response (handshaking) method, and ASCII-encoding the values before sending.
April 17, 2012, at 07:17 PM by Scott Fitzgerald -
Changed lines 5-6 from:

This sketch uses the Serial.parseInt() function to locate comma separated values. The values are parsed into ints and used to fade a RGB LED.

to:

This sketch uses the Serial.parseInt() function to locate comma separated values. The values are parsed into ints and used to determine the color of a RGB LED. You'll use the serial monitor to send strings like "5,220,70" to the Arduino to change the lights.

April 17, 2012, at 07:14 PM by Scott Fitzgerald -
Changed lines 25-27 from:

LEDs that are common anode have a common power source. They behave differently than other LEDs you've probably used with your Arduino. Instead of turning a pin HIGH to illuminate the LED, we would turn the pin LOW, to create a voltage difference. So sending 255 via PWM is the same as turning it off, while 0 is the same as turning it on

to:

RGB LEDs with a common anode share a common power pin. Instead of turning a pin HIGH to illuminate the LED, you need to turn the pin LOW, to create a voltage difference across the diode. So sending 255 via analogWrite() turns the LED off, while a value of 0 turns it on at full brightness.

April 17, 2012, at 04:31 AM by Scott Fitzgerald -
Changed lines 5-6 from:

This sketch shows uses the Serial parseInt() function to locate comma separated values. The values are parsed into ints and used to fade a RGB LED.

to:

This sketch uses the Serial.parseInt() function to locate comma separated values. The values are parsed into ints and used to fade a RGB LED.

Changed lines 25-27 from:

LEDs that are common anode have a common power source. They

to:

LEDs that are common anode have a common power source. They behave differently than other LEDs you've probably used with your Arduino. Instead of turning a pin HIGH to illuminate the LED, we would turn the pin LOW, to create a voltage difference. So sending 255 via PWM is the same as turning it off, while 0 is the same as turning it on

Deleted line 41:
April 17, 2012, at 01:04 AM by Scott Fitzgerald -
Changed lines 19-27 from:
to:

You'll need five wires to make the circuit above. Connect a red wire to one of the long vertical rows on your breadboard. Connect the other end to the 5V pin on your Arduino.

Place an RGB LED on your breadboard. Check the datasheet for your specific LED to verify the pins. Connect the power rail you just created to the common anode on the LED.

With your remaining wires, connect your red cathode to pin 3, green cathode to pin 5, and blue cathode to pin 6.

LEDs that are common anode have a common power source. They

Added lines 29-31:

April 16, 2012, at 08:28 PM by Scott Fitzgerald -
Changed lines 15-16 from:
to:
April 16, 2012, at 08:28 PM by Scott Fitzgerald -
Changed lines 15-16 from:
to:
Deleted lines 19-22:

None, but the Arduino has to be connected to the computer.

April 16, 2012, at 08:26 PM by Scott Fitzgerald -
Changed lines 3-6 from:

ASCII Table

Demonstrates the advanced serial printing functions by generating a table of characters and their ASCII values in decimal, hexadecimal, octal, and binary. For more on ASCII, see asciitable.com

to:

Read ASCII String

This sketch shows uses the Serial parseInt() function to locate comma separated values. The values are parsed into ints and used to fade a RGB LED.

Changed lines 15-16 from:
to:
Changed line 36 from:
to:
April 16, 2012, at 08:01 PM by Scott Fitzgerald -
Changed lines 9-12 from:
to:
  • Breadboard
  • Hookup wire
  • Common anode RGB LED
April 16, 2012, at 07:54 PM by Scott Fitzgerald -
Added lines 1-33:

Share