Skip to content

Instantly share code, notes, and snippets.

@buildcircuit
Created December 9, 2020 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buildcircuit/448d308f7102b64a2d37440babd446d7 to your computer and use it in GitHub Desktop.
Save buildcircuit/448d308f7102b64a2d37440babd446d7 to your computer and use it in GitHub Desktop.
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