Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created June 28, 2020 22:14
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 JeffersGlass/4daf277dcac7af15ef9136d841e857bb to your computer and use it in GitHub Desktop.
Save JeffersGlass/4daf277dcac7af15ef9136d841e857bb to your computer and use it in GitHub Desktop.
const int LEDPIN = 6;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.setTimeout(200);
pinMode(LEDPIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
while (Serial.available()) {
uint16_t inValue = Serial.read();
analogWrite(LEDPIN, inValue);
Serial.println(inValue);
//Serial.flush();
}
if (millis() % 1000 > 900) digitalWrite(LED_BUILTIN, HIGH);
else digitalWrite(LED_BUILTIN, LOW);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment