Skip to content

Instantly share code, notes, and snippets.

@bertbalcaen
Last active December 21, 2015 01:49
Show Gist options
  • Save bertbalcaen/6230811 to your computer and use it in GitHub Desktop.
Save bertbalcaen/6230811 to your computer and use it in GitHub Desktop.
Control brightness over serial
int ledPin = 11;
void setup(){
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop(){
while(Serial.available() > 0){
byte val = Serial.read();
Serial.print("Receiving value from Bluetooth: ");
Serial.println(val);
analogWrite(ledPin, val);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment