SmartInsoles

Play games on the go with a SmartInsole! Presenting at Bay Area MakerFaire 2014!

Work in progress7,252
SmartInsoles

Things used in this project

Hardware components

Flora
Adafruit Flora
×1
BLE Mini
×1
Conductive Thread
×1
Thread
×1
Button Clasps
×8
Velostat
×1
Battery 3.3 Volt
×1
Ribbon Cable
×1

Story

Read more

Code

adafruit_flora_smart_insoles_hackathon_code.

Plain text
adafruit_flora_smart_insoles_hackathon_code.
#include <CapPin.h>
#include <SPI.h>
#include <boards.h>
#include <services.h>
#include <ble_mini.h>
#define FSR_SENSE A7

CapPin cPin_10 = CapPin(12);    // read pin 10 (D10 on Flora) - connect to NES B
CapPin cPin_9  = CapPin(9);
CapPin pins[] = {
  cPin_10, cPin_9};

unsigned long currentMillis;        // store the current value from millis()
unsigned long previousMillis;       // for comparison with currentMillis
int samplingInterval = 0;          // how often to run the main loop (in ms)

void setup(){
  BLEMini_begin(57600);
  Serial.begin(57600);
}

void loop() {

  while(BLEMini_available()==3) {
   
    byte pinColor=BLEMini_read();
    byte pinState=BLEMini_read();
    //delay(20);
    Serial.println("Pushing Data");
    /*Serial.println(pinColor);
     Serial.println(pinState);*/
    switch (pinColor){
    case 0xA7:
      {
        uint16_t fsrRead = analogRead(FSR_SENSE);
        //Serial.println(fsrRead);
        BLEMini_write(0x0B);
        BLEMini_write(fsrRead >> 8);
        BLEMini_write(fsrRead);
        delay (10);
       // Serial.println("WE ARE HERE 1");
        break;
      }
    case 0xAB:
      {
        uint16_t frontFoot =  pins[0].readPin(2000);
         BLEMini_write(0x0B);
         BLEMini_write(frontFoot >> 8);
         BLEMini_write(frontFoot);
         delay(10);
        break;
      }
    case 0xA9:
      {
       uint16_t  backFoot  = pins[1].readPin(2000);
         BLEMini_write(0x0B);
         BLEMini_write(backFoot >> 8);
         BLEMini_write(backFoot);
         delay(10);
        break;
      }
    }

  }

}

maker_faire_adruino_code.

Plain text
maker_faire_adruino_code.
#include <SPI.h>
#include <boards.h>
#include <services.h>
#include <ble_mini.h>

int RT=A7;
int RB=A9;
int LB=A10;
int LT=A11;

void setup(){
  BLEMini_begin(57600);
  Serial.begin(9600);
}

void loop(){
  while(BLEMini_available()==3) {

    int rtRead=analogRead(RT);

    int rbRead=analogRead(RB);
    int ltRead=analogRead(LT);
    int lbRead=analogRead(LB);
    BLEMini_write(0x0A);
    BLEMini_write(rtRead>>8);
    BLEMini_write(rtRead);
    BLEMini_write(0x0B);
    BLEMini_write(rbRead>>8);
    BLEMini_write(rbRead);
    BLEMini_write(0x0C);
    BLEMini_write(ltRead>>8);
    BLEMini_write(ltRead);
    BLEMini_write(0x0D);
    BLEMini_write(lbRead>>8);
    BLEMini_write(lbRead);
  }
}

Github

Github

Credits

Karen Yee

Karen Yee

2 projects • 5 followers
tech enthusiast, product management, finance & analytics, cognitive science
Anupam Jindal

Anupam Jindal

2 projects • 4 followers
Technology lover, iOS developer, Product Manager, Java developer
Manny Karyampudi

Manny Karyampudi

2 projects • 4 followers
Generalist Engineer | Android Development | Web Development | Business Analysis
Daniel Chen

Daniel Chen

2 projects • 1 follower
Alex Yee

Alex Yee

2 projects • 2 followers
hardware hacker, BLE enthusiast, Arduino hackster
Chuck Huie

Chuck Huie

1 project • 1 follower
Engineer

Comments