Hardware components | ||||||
| × | 1 | ||||
![]() |
| × | 1 | |||
| × | 1 |
This Project shows how to control robotic arm Gripper to make it open and close with different angles to pick up things using 1SHEELD & slider 1SHEELD app. on smartphones
Untitled file
Warning: Embedding code files within the project story has been deprecated. To edit this file or add more files, go to the "Software" tab. To remove this file from the story, click on it to trigger the context menu, then click the trash can button (this won't delete it from the "Software" tab).
/*
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);
}
/*
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);
}
2 projects • 11 followers
Head of embedded Systems at CECE lab
Cairo university
Comments