Created
December 9, 2020 07:53
-
-
Save buildcircuit/448d308f7102b64a2d37440babd446d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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