📜 ⬆️ ⬇️

Super button for Munchkin

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

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

Making an order on the website www.sparkfun.com, I came across such a button :
image
It can be said that the button is 1: 1 in scale, it is almost 10 cm in diameter.
The timer and the squeaker decided to do at attiny85 (there was actually nothing else).

To illuminate the button, I disassembled the “flashlight” (which came as a bonus to another order with DX)

')
I am not very strong in circuit design, so I will be especially happy to comment about the circuit:

Transistors are torn from the dead matplat: 1AM is written on them, this is MBT3904LT1
The programmer used this :
image
As a tweeter connected small speaker from the company:

When you turn on the power or press the button (and this is a reset), the LED lights up, a short “beep” is made every second, after a time (2.6 seconds) the LED goes out and a long final “beep” is given. Then the processor is hibernated.
The program turned out just minimalist.
#include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #include <avr/sleep.h> 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 persecute the board, I did everything by mounting it, it looks awful, but in an opaque case it is not noticeable.

As a power source 1 lithium battery, I had 18,500 rolls. He, unfortunately, is not protected, so you will sometimes have to look after him. It is better, of course, to take something like 18650 protected

The logic of work is simple: they turn on the LED, squeak, turn the percent into hibernation. In hibernation, the percent consumes almost nothing, so the power switch is not needed. Those. Accum can not touch for several months.

As the body used spindle 25 blanks.
At the beginning, the transparent cap was painted and pasted a piece of paper:

The next day, the sticker peeled off along with the paint. Therefore, the cap was repainted, the sticker was not re-sculpted.

The final result looks like this:


With a button, it is played like this:
he who in battle says something like: “I defeat him 18 against 10”. If disputes begin, then presses the button, after the final "beep" cards are not accepted.


UPD: Character Sheet

Source: https://habr.com/ru/post/116550/


All Articles