Nawres ArifMohammed Hassan
Published © Apache-2.0

Real-time positioning using 1sheeld and 3Ds MAX (NO GPS !)

making precise positioning device without GPS or satellites by using Arduino, 1sheeld, Android phone, USP joystick and 3Ds MAX so

IntermediateWork in progress3,487
Real-time positioning using 1sheeld and 3Ds MAX (NO GPS !)

Things used in this project

Hardware components

1Sheeld
1Sheeld
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
joystick (USP)
×1
PC (computer with 3Ds MAX installed)
×1
Android smart phone
×1
NPN transistor
×4

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

1SHEELD-diagram.png

Code

Arduino code for accelerometer and X , Y directions

C/C++
Code for reading the accelerometer X , Y readings and control +X,-X,+Y,-Y axis of joystick by 4 output pins
#define CUSTOM_SETTINGS
#define INCLUDE_ACCELEROMETER_SENSOR_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

/* Variables for the accelerometer's values in 3 dimensions. */
float x, y, z;
int A = 10;
int B = 11;
int C= 12;
int D = 13;
void setup() {
 /* Start communication. */
  OneSheeld.begin();
   pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  /* Always get the values of the accelerometer in the 3 dimensions (X, Y and Z). */
  x=AccelerometerSensor.getX();
  y=AccelerometerSensor.getY();
   if(x > 0.5)
  {
    digitalWrite(A,HIGH);
    digitalWrite(C,LOW);
  }
    delay(1);
 if(x < -0.5)
{
    digitalWrite(C,HIGH);
    digitalWrite(A,LOW);
  }
delay(1);
   if(y > 0.5)
  {
    digitalWrite(B,HIGH);
    digitalWrite(D,LOW);
  }
    delay(1);
      if(y <-0.5)
  {
    digitalWrite(D,HIGH);
    digitalWrite(B,LOW);
  }
delay(1);
if (-0.5<x>0.5)
{
    digitalWrite(A,LOW);
    digitalWrite(C,LOW);
}
if (-0.5<y>0.5)
{
    digitalWrite(D,LOW);
    digitalWrite(B,LOW);
}
}

Credits

Nawres Arif

Nawres Arif

3 projects • 18 followers
Science Camp (the Iraqi maker space) founder Occupation: Pharmacist
Mohammed Hassan

Mohammed Hassan

3 projects • 12 followers
Electrical engineer and maker, Science camp(Iraqi maker space) co-founder, interested in Following up with new tech and entrepreneurship

Comments