Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created June 28, 2020 22:13
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/4efd794c7a227cfeebd9c92d933e38e3 to your computer and use it in GitHub Desktop.
Save JeffersGlass/4efd794c7a227cfeebd9c92d933e38e3 to your computer and use it in GitHub Desktop.
uint8_t value = 0;
const int LEDPIN = 11;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LEDPIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
value = (value + 10) % 255;
analogWrite(LEDPIN, value);
Serial.write(value);
delay(100);
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