Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const int redPin = 3;
#define FADESPEED 1
void setup() {
Serial.begin(38400);
pinMode(redPin, OUTPUT);
Serial.print("Arduino control RGB LEDs Connected OK ( Sent From Arduinno Board )");
Serial.print('\n');
}
void loop() {
while (Serial.available() > 0) {
// look for the next valid integer in the incoming serial stream:
int red = Serial.parseInt();
red = constrain(red, 0, 255);
analogWrite(redPin, red);
Serial.print("Data Response : ");
Serial.println(red);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment