aligamalaziz
Created February 11, 2016

control ARM with arduino and 1sheeld and Android

the control robot arm with arduino and 1sheeld and Android

Advanced5 hours214
control ARM with arduino and 1sheeld and Android

Things used in this project

Story

Read more

Custom parts and enclosures

Step 1: Components

Frthsr2i5bs3944.large

Step 2: Arduino Sketch and Mobile Application

F1ivconi5bs39s0.large

Step 3: Test

Fzyzdini5bs3b2g.large

Schematics

IMG_20160204_130359.jpg

Img 20160204 130359

IMG_20160204_130252.jpg

Img 20160204 130252

IMG_20160204_130259.jpg

Img 20160204 130259

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

14 02 2016%2006 26 36%20%d8%b5

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 • 0 followers
i'am ali gamal azize i like projects
Contact

Comments