aligamalaziz
Created February 11, 2016

control ARM with arduino and 1sheeld and Android

the control robot arm with arduino and 1sheeld and Android

Advanced5 hours219
control ARM with arduino and 1sheeld and Android

Things used in this project

Hardware components

1Sheeld
1Sheeld
×1
Arduino UNO
Arduino UNO
×1
Android Smart phone
×1
6 DOF Robotic Arm
×1

Software apps and online services

1sheeld

Story

Read more

Custom parts and enclosures

Step 1: Components

Step 2: Arduino Sketch and Mobile Application

Step 3: Test

Schematics

IMG_20160204_130359.jpg

IMG_20160204_130252.jpg

IMG_20160204_130259.jpg

14-02-2016 06-26-36 ص.png

Code

New Text Document.txt

C/C++
#include  <Servo.h>
#include <OneSheeld.h>
Servo myservo1;
Servo myservo2;
Servo myservo5;
Servo myservo6;
void setup() 
{ 
  OneSheeld.begin();
  myservo1.attach(3);
  myservo1.write(0);
  myservo2.attach(5);
  myservo2.write(0);
  myservo5.attach(10);
  myservo5.write(70);
  myservo6.attach(11);
  myservo6.write(10);
  analogWrite(6, 200);
  analogWrite(9, 200);
} 
void loop() {
  if (ProximitySensor.getValue() > 0)
    myservo6.write(10);
  else 
    myservo6.write(120);
  if(OrientationSensor.getX() > 0 && OrientationSensor.getX() <= 180)
    myservo1.write(map(abs(OrientationSensor.getX()),0,180,180,0));   
  if(OrientationSensor.getY() < -90 && OrientationSensor.getY() >= -180)
  myservo2.write(map(abs(OrientationSensor.getY()),180,90,0,90));
  if(OrientationSensor.getZ() > 0 &&  abs(OrientationSensor.getZ()) <= 60)
    myservo5.write(map(OrientationSensor.getZ(),0,60,70,180));   
  if(OrientationSensor.getZ() < 0 &&  abs(OrientationSensor.getZ()) <= 60)
    myservo5.write(map(abs(OrientationSensor.getZ()),0,60,70,0));
  OneSheeld.processInput();
}

Credits

aligamalaziz

aligamalaziz

3 projects • 4 followers
i'am ali gamal azize i like projects

Comments