Tanishq Jaiswal
Published

Control electronics by sliding your phone

Combine RF and an Arduino to control electronics from your Android smartphone phone.

BeginnerFull instructions provided28,001
Control electronics by sliding your phone

Things used in this project

Story

Read more

Schematics

FBTWWWBID0PU6Q6.LARGE.jpg

Code

Untitled file

Arduino
#include <OneSheeld.h>

int ledPin1 = 11;

float xOrientation;

void setup() {

/* Start communication. */

OneSheeld.begin();

pinMode(ledPin1,OUTPUT);

}

void loop() {

// Check X-axis orientation.

xOrientation = OrientationSensor.getX();

// Map orientation to brightness

if(xOrientation < 102) analogWrite(ledPin1,xOrientation * 2.5);
// Or turn off the LED if the orientation is > 125 degrees

else analogWrite(ledPin1, 0);

}

Codebender.cc

upload this to your arduino

Credits

Tanishq Jaiswal

Tanishq Jaiswal

39 projects • 54 followers
I'm from India and love making projects on electronics and especially with Arduino.

Comments