Skip to content

Instantly share code, notes, and snippets.

@soha
Created March 13, 2016 14:59
Show Gist options
  • Save soha/30cbd50181306b6a8a4e to your computer and use it in GitHub Desktop.
Save soha/30cbd50181306b6a8a4e to your computer and use it in GitHub Desktop.
#include <Servo.h>
#define servoPIN 9
#define ledPIN 7
Servo myservo;
bool firstMessage = true;
void setup() {
myservo.attach(servoPIN);
Serial.begin(9600);
Serial.print(F("\r\nSPP Bluetooth Library Started"));
myservo.write(0);
}
void loop() {
char c;
c = Serial.read();
if (c == '1') {
delay(10);
myservo.write(45);
delay(1000);
myservo.write(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment