Things used in this project

Hardware components:
8186014 rd
Pebble Time
×1
Software apps and online services:
Capitol One Api
Hand tools and fabrication machines:
Wallet

Code

Transactr Pebble CodeJavaScript
var ajax = require('ajax');
var UI = require('ui');
var Vector2 = require('vector2');
var Accel = require('ui/accel');

var x,y,z,deltaY,previousY;

var main = new UI.Card({
  title: 'Wallet',
  icon: 'images/menu_icon.png',
  subtitle: 'Waiting for a transaction!',
  subtitleColor: 'indigo', // Named colors
});

main.show();

main.on('click', 'select', function(e) {
  var wind = new UI.Window({
    fullscreen: true,
  });
	
  var textfield = new UI.Text({
    position: new Vector2(0, 65),
    size: new Vector2(144, 30),
    font: 'gothic-24-bold',
    text: 'Text Anywhere!',
    textAlign: 'center'
  });
  wind.add(textfield);
  wind.show();
});

var walletOpened = function() {
Accel.on('data', function(e) {          
        Accel.config(25, 1, true);
        
        x = e.accel.x;
        y = e.accel.y;
        z = e.accel.z;
	
				deltaY = y - previousY;
		
				if(deltaY > 400 || deltaY < -400) {
					console.log("Wallet Opened");
						 ajax(
         		 {
               url: 'http://2d5149ff.ngrok.io/walletOpen',
               method: 'get',
               type: 'json',
               crossDomain: true
          		});
				}
				previousY = y;
    });
};

var accel2 = function() {
     Accel.init();
     console.log("accel2 is called");
     setInterval(walletOpened, 10000);     
};

accel2();

Credits

7a5dcef1cff379179da33a1c234d76bd
Shashank Sharma

A high school hacker that loves to make things

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Life Saver
Intermediate
  • 3,877
  • 72

Work in progress

Detect road accident, raise SOS, share location, share & monitor vital health stats during accident using Pebble. #SaveLife

Life Saver

Team Enigma

Pebble controlled DIY SmartGarage with the Sparkcore
Intermediate
  • 7,408
  • 97

Full instructions

Build it yourself and control your garage door with the Pebble Smartwatch and the Sparkcore

Smartwatch car remote
Intermediate
  • 11,661
  • 73

Full instructions

Controlling a car using a Pebble watch, an Android phone and an Arduino

Particle Sumo Bot
Intermediate
  • 3,437
  • 59

Full instructions

3D Printed Particle.io powered Sumo Bot with Pololu motor controller

RunTracker One
Intermediate
  • 963
  • 17

Work in progress

Go running with only one device - your smartwatch - and still enjoy all your music, GPS tracking, and more!

RunTracker One

Team Wesley Crushers

PebbleCannon
Intermediate
  • 972
  • 17

Vanquish your foes, control a nerf gun with your pebble watch.

Add projectSign up / Login