Nawres ArifMohammed Hassan
Published © MPL-2.0

Light Trainer

Athlete training device helps to enhance the response speed of players through optical stimulation.

IntermediateFull instructions provided6,309
Light Trainer

Things used in this project

Story

Read more

Custom parts and enclosures

PCB

Disk

arduino with custom sheild

encloser

Schematics

Ir sensor circuit

Led

Code

light trainer

Arduino
int ledselect;
int led1 = 1; 
int led2 = 2; 
int led3 = 3; 
int led4 = 4; 
int led5 = 5; 
int led6 = 6; 
int ir1 = 7;
int ir2 = 8;
int ir3 = 9;
int ir4 = 10;
int ir5 = 11;
int ir6 = 12;
int s1=A0;
int s2=A1;
int s3=A2;
int s4=A3;
int s5=A4;
int s6=A5;
void setup() { 
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(ir1, OUTPUT);
pinMode(ir2, OUTPUT);
pinMode(ir3, OUTPUT);
pinMode(ir4, OUTPUT);
pinMode(ir5, OUTPUT);
pinMode(ir6, OUTPUT);
pinMode(s1, INPUT);
pinMode(s2, INPUT);
pinMode(s3, INPUT);
pinMode(s4, INPUT);
pinMode(s5, INPUT);
pinMode(s6, INPUT);
}
void loop() {
int ledselect = random(6); 
switch (ledselect) {
case 0:
digitalWrite(led1, HIGH);
digitalWrite(ir1, HIGH);
delay(20);
while(analogRead(s1) >= 950){delay(20);}
digitalWrite(led1,LOW);
break;
case 1:
digitalWrite(led2, HIGH);
digitalWrite(ir2, HIGH);
delay(20);
while(analogRead(s2) >= 950){delay(20);}
digitalWrite(led2,LOW);
break;
case 2:
digitalWrite(led3, HIGH);
digitalWrite(ir3, HIGH);
delay(20);
while(analogRead(s3) >= 950){delay(20);}
digitalWrite(led3,LOW);
break;
case 3:
digitalWrite(led4, HIGH);
digitalWrite(ir4, HIGH);
delay(20);
while(analogRead(s4) >= 950){delay(20);}
digitalWrite(led4,LOW);
case 4:
digitalWrite(led5, HIGH);
digitalWrite(ir5, HIGH);
delay(20);
while(analogRead(s5) >= 950){delay(20);}
digitalWrite(led5,LOW);
case 5:
digitalWrite(led6, HIGH);
digitalWrite(ir6, HIGH);
delay(20);
while(analogRead(s6) >= 950){delay(20);}
digitalWrite(led6,LOW);
break;
default:
delay(2000);
break;
}

}

Credits

Nawres Arif

Nawres Arif

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

Mohammed Hassan

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

Comments