For this lab we will be creating a Servo motor that can be controlled with a smart phone. The app needed for this is called bkynk and you will need to download it to your smart phone and the library for your aduino.
http://docs.blynk.cc/#hardware-set-ups-arduino-ove...
That is the website where you can get the library.
Also once the servo goes past a certain position, an LED light will turn on.
#define BLYNK_PRINT SwSerial
#include <softwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleStream.h>
#include <servo.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "645f1bbd27c4410c81a5f9d89aa75260";
Servo servo;
BLYNK_WRITE(V3)
{
servo.write(param.asInt());
}
void setup() {
// Debug console
SwSerial.begin(9600);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
servo.attach(9);
}
void loop() {
Blynk.run();
if(param.asInt() > 90)
{
digitalWrite(13, HIGH);
}
else
{
digitalWrite(13, LOW);
}
}
}
for use with the blynk app, consult this page.
http://docs.blynk.cc/#hardware-set-ups-arduino-over-usb-no-shield