Arduino "Reaction Timer" - My Kids Love Playing This

Arduino "Reaction Timer" - My Kids Love Playing This © GPL3+

Wait for light - press a button. So simple but so funny. All our family plays the game.

  • 182 views
  • 5 comments
  • 4 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

About this project

I discovered the code somewhere on the Internet and tried it.

All my family loved the game and I decided to assemble it in a funny case to be able to play.

The work is now finished and it is into the hands of my kids.

It is a very basic project but in a kind of case which hides all elements.

Here are some pictures:

Please do not hesitate to ask me questions if needed.

Code

Here's the codeArduino
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#define btnSTART 5
#define btnHIT 7
#define ledTrigger 9
LiquidCrystal_I2C lcd(0x23,20,4);

void setup() {
  lcd.init(); 
  lcd.backlight();
  pinMode(btnSTART, INPUT_PULLUP);
  pinMode(btnHIT, INPUT_PULLUP);
  pinMode(ledTrigger, OUTPUT);
  digitalWrite(ledTrigger, LOW);
  lcd.print("Salut Famille!");
  delay(2000);
  lcd.clear();
  randomSeed(analogRead(0));
}

void loop() {
  long timeReaction;
  long timeTotal = 0;
  lcd.print("Press START!");
  while (digitalRead(btnSTART)) {}
  delay(10);
  while (!digitalRead(btnSTART)) {}
  lcd.clear();
  lcd.print("Jouez!!!");
  delay(1000);
  for (int i = 0; i < 5; i++) {
    delay(random(500, 5000));
    timeReaction = millis();
    digitalWrite(ledTrigger, HIGH);
    while (digitalRead(btnHIT)) {}
    timeReaction = millis() - timeReaction;
    timeTotal += timeReaction;
    delay(10);
    while (!digitalRead(btnHIT)) {}
    digitalWrite(ledTrigger, LOW);
    lcd.clear();
    lcd.print(i + 1);
    lcd.print(": ");
    lcd.print(timeReaction);
    delay(1000);
  }
  lcd.clear();
  lcd.print("Moyenne = ");
  lcd.print(timeTotal/5);
  delay(10000);
  lcd.clear();
  }

Schematics

My first fritzing essay
reaction_timer_nFqVp0hMaj.fzz

Comments

Similar projects you might like

Cube for Kids

Project tutorial by Thomas Angielsky

  • 1,735 views
  • 0 comments
  • 7 respects

sC00p-4-b1l1tY Meter

Project showcase by Team sC00p-4-b1l1tY

  • 817 views
  • 2 comments
  • 2 respects

Reaction Timer - F1 Style

Project in progress by LAGSILVA

  • 1,650 views
  • 0 comments
  • 8 respects

Weather Station for Drones

Project tutorial by Giuseppe Caccavale

  • 12,510 views
  • 4 comments
  • 42 respects

Arduino101 / tinyTILE BLE: Match-Making Sunglasses

Project tutorial by Kitty Yeung

  • 12,260 views
  • 5 comments
  • 41 respects

Circuito Arduino Controller Pad

Project tutorial by AhmedAzouz

  • 3,158 views
  • 1 comment
  • 9 respects
Add projectSign up / Login