Project showcase
LED Dice

LED Dice © LGPL

A very easy project with my library.

  • 2,464 views
  • 2 comments
  • 12 respects

Components and supplies

About this project

My first project on the Arduino Project Hub. This easy project can help you when you have no dice, for example, in Monopoly.

P.S sorry for photo quality, I was taking it with my Internet camera! I arleady made a library for this project for full comfort.

Download library here.

Code

Dice.inoC/C++
#include <DiceController.h> // Including our library

Dice dice(2,3,4,5,6,7,8,9,10); // Led configuration

int repeats; // Setting variable for repeats

void setup() {
  pinMode(A0,INPUT); // Configuring button
}

void loop() {
  repeats = 0; // Reseting repeats
  if (analogRead(A0) == 1023) {
    while (repeats < 4) {
      int selectedNumber = random(1,6); // Randoming number
      dice.setNumber(selectedNumber); // Setting randomed number
      repeats++; // Increasing variable for repeat
      delay(100); // Delay for good visibility
    }
  }
}

Schematics

Schematic
Other leds connect like in schematic
dice_7tC4CvNU74.fzz

Comments

Similar projects you might like

LED Dice

Project showcase by EvdS

  • 14,281 views
  • 11 comments
  • 49 respects

LED Dice

Project showcase by Team ONYX

  • 7,461 views
  • 1 comment
  • 17 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,312 views
  • 4 comments
  • 34 respects

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 10,052 views
  • 5 comments
  • 20 respects

Turn On and Off LED by LDR (Toggle LDR)

Project showcase by muhammed amar slik

  • 19,803 views
  • 1 comment
  • 13 respects

LED Blink Pattern

Project tutorial by Matt Arnold

  • 30,416 views
  • 14 comments
  • 84 respects
Add projectSign up / Login