/*
Slider Shield Example
This example shows an application on 1Sheeld's slider shield.
By using this example, you can control the angle
of the servo connected to the ARM gripper using the app's slider.
*/
/* Include 1Sheeld library. */
#include <OneSheeld.h>
/* Define a variable to hold the value of the slider. */
int value;
/* A name for the Servo on pin 11. */
int servoPin = 11;
void setup()
{
/* Start communication. */
OneSheeld.begin();
/* Set the speaker pin as output. */
pinMode(servoPin,OUTPUT);
}
void loop()
{
/* Always get the value of the slider and output it as PWM to pin 11. */
value = Slider.getValue();
analogWrite(servoPin,value);
}
Comments