Skip to content

Instantly share code, notes, and snippets.

@jacobrosenthal
Created December 7, 2014 08:57
Show Gist options
  • Save jacobrosenthal/69093da97374ea8efc2a to your computer and use it in GitHub Desktop.
Save jacobrosenthal/69093da97374ea8efc2a to your computer and use it in GitHub Desktop.
Light Blue Bean Slider Control Servo Example
#define CONTROL 0
int servoPin = 0;
void setup(){
pinMode(servoPin, OUTPUT);
}
void loop(){
// Get any serial input from sandbox IOS app
char buffer[64];
size_t length = 64;
length = Serial.readBytes(buffer, length);
if ( length > 0 )
{
if( buffer[0] == CONTROL)
{
analogWrite(servoPin, buffer[1]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment