top of page

Ledring

20200107_203427_InPixio.png

THE

Ledring

Ledring is a great toy for who is want to make this jobs more enjoyable. Sometimes Arduino's are can be run for entertainment purposes. Here is a way to use Arduino like this. Code it and play everywhere with your family and friends. Make a game with Arduino!

Make

2 Game

or

MORE

Led catching game

Led overlap game

3213123.png

PLAY

EVERYWHERE

​You can play everywhere you want with 2 CR2032 3Vx2 batteries
Led catching game

The leds start to flash in order, if you click the button when the green led lights up, you win the game.

Led overlap game

​The leds start to flash in order, if you click the button when the latest led lights up, and keep doing this 19 times all leds one by one will light up and you win the game.

kırpt.png

2x Coin Cell Battery 

Batteries achieve the desired operating voltage by connecting several cells in series; each cell adds its voltage potential to derive at the total terminal voltage. We are using 2 cr2032 3v battery for run to Arduino with 6v. Each cr2032 batteries voltage is 3 volt and with this pcb design, they are in series connection between themselves. The Arduino continues to work while the batteries remain attached. Remove the batteries to stop working.

*Ledring is not working with coin cell battery in Led overlap game mode.

Coding Part

Led catching
int leds[] = {14, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, A5, A4, A3, A2, A1, A0, 2};
int buton = A6;
int butonstate;
int butoninit = 0;
static int i = 0;
int num_pins = 20;
 
void setup()
{
  pinMode(buton, INPUT);
  for (int z = 0; z < 20; z++) {
    pinMode(leds[z], OUTPUT);
  }
  digitalWrite(0, LOW);
}
void loop()
{
  butonstate = analogRead(buton);
  if (butonstate == 0) {
    butoninit = 1;
  }
  if (butonstate == 1) {
    butoninit = 0;
  }
  if (butoninit == 1 && i == 19) {
    digitalWrite(leds[19], HIGH);
    delay(200);
    digitalWrite(leds[19], LOW);
    delay(200);
    digitalWrite(leds[19], HIGH);
    delay(200);
    digitalWrite(leds[19], LOW);
    delay(200);
    digitalWrite(leds[19], HIGH);
    delay(200);
    digitalWrite(leds[19], LOW);
    delay(200);
    digitalWrite(leds[19], HIGH);
    delay(200);
    digitalWrite(leds[19], LOW);
    delay(200);
    digitalWrite(leds[19], HIGH);
    delay(200);
    digitalWrite(leds[19], LOW);
    delay(200);
    butoninit = 0;
    i = 0;
  }
  if (butoninit == 1 && i != 19) {
    digitalWrite(leds[i], HIGH);
    delay(300);
    digitalWrite(leds[i], LOW);
    delay(300);
    digitalWrite(leds[i], HIGH);
    delay(300);
    digitalWrite(leds[i], LOW);
    butoninit = 0;
    i = 0;
  }
  ledaction();
}
 
void ledaction() {
  static unsigned long time = millis();
  if (millis() - time >= 80) //80 easy 40 normal 10 hard
    {
    time = millis();
    i++;
    digitalWrite(leds[i], HIGH);
    delay(15);
    if (i == 20) {
      i = 0;
    }
    digitalWrite(leds[i], LOW);
  }
}
Led overlap
int leds[] = {14, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, A5, A4, A3, A2, A1, A0, 2};
int buton = A6;
int butonstate;
int butoninit = 0;
static int i = 0;
static int tourtime = 120; 
static int lednumber = 18; 
static int lednumber1 = 19;
void setup()
{
  pinMode(buton, INPUT);
  for (int z = 0; z < 20; z++) {
    pinMode(leds[z], OUTPUT);
  }
  digitalWrite(0, LOW);
}
void loop()
{
  butonstate = analogRead(buton);
  if (butonstate == 0) {
    butoninit = 1;
  }
  if (butonstate == 1) {
    butoninit = 0;
  }
  ledaction();
}
 
void ledaction() {
  static unsigned long time = millis();
  if (millis() - time >= tourtime) {
    time = millis();
    i++;
    digitalWrite(leds[i], HIGH);
    delay(15);
    digitalWrite(leds[i], LOW);
    if (i == lednumber1) {
      ledsoff();
      tourtime = 120; 
      lednumber = 18; 
      lednumber1 = 19;
      butoninit = 0;
      i = 0;
    }
    if (butoninit == 1 && i == lednumber) {
      digitalWrite(leds[lednumber], HIGH);
      tourtime - 20;
      lednumber--;
      lednumber1--;
      butoninit = 0;
      i = 0;
      delay(150);
    }
    if (butoninit == 1 && i != lednumber) {
      ledsoff();
      tourtime = 120; 
      lednumber = 18; 
      lednumber1 = 19;
      butoninit = 0;
      i = 0;
    }
  }
}
void ledsoff() {
  digitalWrite(leds[0], LOW);
  digitalWrite(leds[1], LOW);
  digitalWrite(leds[2], LOW);
  digitalWrite(leds[3], LOW);
  digitalWrite(leds[4], LOW);
  digitalWrite(leds[5], LOW);
  digitalWrite(leds[6], LOW);
  digitalWrite(leds[7], LOW);
  digitalWrite(leds[8], LOW);
  digitalWrite(leds[9], LOW);
  digitalWrite(leds[10], LOW);
  digitalWrite(leds[11], LOW);
  digitalWrite(leds[12], LOW);
  digitalWrite(leds[13], LOW);
  digitalWrite(leds[14], LOW);
  digitalWrite(leds[15], LOW);
  digitalWrite(leds[16], LOW);
  digitalWrite(leds[17], LOW);
  digitalWrite(leds[18], LOW);
  digitalWrite(leds[19], LOW);
  digitalWrite(leds[20], LOW);
}

BUY NOW

Download Links

Datasheet 
Example Codes
bottom of page