Anthony’s Switch

I will start off by posting my code that I used

int led1 = 9;
int led2 = 11;

int out1 = 2;
int out2 = 3;

int in1 = 6;
int in2 = 7;
int val1, val2;

void setup() {
// put your setup code here, to run once:
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);

pinMode(out1, OUTPUT);
pinMode(out2, OUTPUT);

pinMode(in1 , INPUT);
pinMode(in2 , INPUT);
}

void loop() {
digitalWrite(out1, HIGH);
digitalWrite(out2, HIGH);

val1 = digitalRead(in1);
val2 = digitalRead(in2);

digitalWrite(led1, val1);
digitalWrite(led2, val2);
}

 

img_0582Here is my physical circuit. You can see the two pull down resistors in the bottom left corner and the two LEDs in the upper left. The gator clips off to the side are connected to the switch that I used. IMG_0583.JPGThis is where the switch is. There is two sensing zones, each one has its unique color. The paper cutout is my quick attempt at a foot. The idea of having to different zones is to be able to tell if you are running with a forefoot strike, heel first strike, or a flat footed strike. Depending on how you strike will change how the LEDs light up.

 

In the image below my pointer finger would be the heel and my thumb will be the front of the foot. Here is a link to it actually working  https://youtu.be/l1PAErJaZ14

 

Also sorry about the extra pictures at the bottom. I can’t see them in the edit window to remove them.

img_0585

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s