Super Button for Munchkin

    image
    Many people know, or at least heard about the Munchkin board game.
    There is such a rule in this game:
    “When you kill or otherwise defeat a monster, give your opponents an acceptable time (about 2.6 seconds) so that they can speak out.”

    Sometimes I really want to measure these very 2.6 seconds, especially when someone thinks for a long time, reads cards, cannot decide what to do. In such cases, we just counted out loud to three, on the number “three” the battle ended.
    I wanted to make some button and a timer, so as not to count out loud.

    Making an order on the site www.sparkfun.com I came across such a button :
    image
    We can say that the button is in a 1: 1 scale, it has a diameter of almost 10 cm.
    I decided to do a timer and a squeaker on attiny85 (actually, there was nothing else).

    To illuminate the buttons, I took apart the “flashlight" (which came as a bonus to another order with DX).


    I'm not very strong at circuitry, so I will be especially happy with comments about the circuit:

    Transistors are torn from the dead motherboard: 1AM is written on them, this is MBT3904LT1
    The programmer used this :
    image
    В a small speaker from the computer is connected as a tweeter:

    When you turn on the power or press the button (and this is reset), the LED lights up, a short “beep” is made every second, after a lapse of time (2.6 seconds) the LED goes out and a long final “beep” is given . Then the processor goes into hibernation.
    The program was simply minimalistic.
    
    #include 
    #include 
    #include 
    #include 
    int main(void)
    {
    	DDRB |= 0x1a;
    	PORTB = 0x18;
    	SoundOn();
    	_delay_ms(50);
    	SoundOff();
    	_delay_ms(950);
    	SoundOn();
    	_delay_ms(50);
    	SoundOff();
    	_delay_ms(950);
    	SoundOn();
    	_delay_ms(50);
    	SoundOff();
    	_delay_ms(550);
    	SoundOn();
    	PORTB = 0x00;
    	_delay_ms(700);
    	SoundOff();
    	PORTB = 0;
    	DDRB = 0;
    	sleep_cpu();
    }
    void SoundOn()
    {
    	TCCR0A = (1 << COM0B0) | (1 << WGM01);
    	TCCR0B = (1 << CS01) ;
    	OCR0A=0x60;
    	TCNT0=0x00;
    	OCR0B=0x00;
    }
    void SoundOff()
    {
    	TCCR0A = 0;
    	TCCR0B = 0;
    }
    


    I didn’t poison the board, I did everything by hanging mounting, it looks awful, but in an opaque case it is invisible.

    As a power source, 1 lithium battery, I had 18500 lying around. Unfortunately, it is not protected, so I will have to glance at it sometimes. It is better to take something like 18650 protected, of course.

    The logic of the work is simple: they turned on the LED, squeaked, transferred the percent to sleep. In hibernation, the percent consumes almost nothing, so the power switch is not needed. Those. Battery can not be touched for several months.

    As the body used spindle for 25 discs.
    In the beginning, the transparent cap was painted with paint and stuck a piece of paper: The next day, the sticker peeled off with the paint. Therefore, the cap was repainted, the sticker was not re-sculpted.



    The final result looks like this:


    The button is played like this: the
    one who says something in the battle says: “I beat him 18 against 10”. If disputes begin, then presses the button, after the final “beep” cards are not accepted. UPD: Character Sheet



    Also popular now: