Skip to content

Instantly share code, notes, and snippets.

@michaelsarduino
Created September 18, 2015 18:41
Show Gist options
  • Save michaelsarduino/0fff02c0251fc2fc002c to your computer and use it in GitHub Desktop.
Save michaelsarduino/0fff02c0251fc2fc002c to your computer and use it in GitHub Desktop.
void setup() {
Serial.begin(9600);
}
int status_led = 0;
void loop() {
if(Serial.available() > 0)
{
int empfangen = Serial.read();
if(empfangen == 48)
{
status_led = status_led - 5;
}
if(empfangen == 49)
{
status_led = status_led + 5;
}
Serial.println(status_led);
analogWrite(11, status_led);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment