Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Electronic game LED thimbles on the microcontroller. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

This electronic device simulates the game "Thimble". Used as thimbles LEDs. The leading player is the microcontroller. The playing field consists of 7 LEDs and is arranged in three rows (Fig. 2). The central row represents thimbles, which are rearranged during the game. The rest of the LEDs are used to indicate the direction of the permutation. The meaning of the game is to track the movement of the original LED (ball) and determine its position at the end of the permutations.

The game has 7 difficulty levels, which differ in the number and speed of permutations. When the device is started, the current difficulty level is displayed with the help of LEDs. Information about it is stored in the non-volatile memory of the microcontroller.

On fig. a schematic diagram of the device is presented. The "+" SB0 and "-" SB1 buttons are used to change the difficulty level. Button "Start" SB2 serves to start the process of the game. Buttons "Pos.1" SB3, "Pos.2" SB4, "Pos.3" SB5 are designed to select the position of the desired LED at the end of the permutation cycle. Button "Reset" SB6 resets the microcontroller. "Pole 1-Pole 7" LEDs HL1-HL7 make up the playing field, where HL1-HL3 is the middle row, HL4-HL5 is the top row, HL6-HL7 is the bottom row. LEDs "Yes" HL8 and "No" HL9 serve to indicate the correctness of the player's answer.

Electronic game LED thimbles on the microcontroller. Schematic diagram of the device
(click to enlarge)

The gameplay looks like this:

The LEDs of this row, and their permutation begins. The position of the desired LED (ball) changes. The direction of the permutations is random. To do this, the algorithm of the microcontroller program uses a linear congruent method for obtaining a pseudo-random number [1]. At the end of such manipulations, the player needs to select the position in which the marked LED is located by pressing the Pos1-Pos3 buttons. If the answer is correct, the green "Yes" LED lights up. In case of an incorrect answer, the red LED "No" lights up, and the field of the true position of the ball flashes.

The device uses an ATTINY 2313 microcontroller [2]. The fuses are configured to work from an internal RC oscillator with a frequency of 8 MHz (CKSEL3-0 equal to 0100). To increase the reliability of working with EEPROM data, a BOD detector is used at a voltage level of 4.3 volts. To enable it, you must assign a value of 100 to the BODLEVEL 2-0 fuses. It is also necessary to disable clock division by 8 (CKDIV8 is 1).

On fig. 2 shows a photograph of the device assembled on a breadboard.

Electronic game LED thimbles on the microcontroller. Breadboard device

Download project file

Literature

1. Wikipedia, ru.wikipedia.org/wiki/Linear_congruent_method 2. ATTINY2313 Datasheet

Author: Anton Garkusha, gam-rainers@mail.ru; Publication: cxem.net

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Safe magnetic socket 03.08.2005

German engineer Klaus-Dieter Fritsch invented the electrical outlet with a plug. Yes, not simple, but safe. You can pick a nail in it, a child can stick a finger in it - nothing bad will happen. Contact occurs only when the plug of the electrical appliance is inserted into the socket.

The secret is in the magnets that are hidden in the socket and in the plug. The plug serves as a magnetic key to the socket. When the poles of the magnets match, voltage is applied to the socket contacts. If in a room, for example, in a laboratory or workshop, there are two electrical networks with different voltages, then by changing the location of the magnets in the plugs, you can make the outlet supply the voltage assigned to each device.

A small batch of magnetic plug-socket sets was ordered by Fritsch in Hungary and was successfully sold out. But the inventor does not have the funds to compete with the major manufacturers of wiring devices, and they do not want to rebuild the established production. True, automakers became interested in Fritsch's system.

Until now, the only "socket" for connecting electrical appliances in the car remains the cigarette lighter socket. The cabin and trunk of the new Volkswagen model will have several magnetic sockets for connecting a coffee maker, a portable TV, a fan, portable lamps and other electrical appliances.

Other interesting news:

▪ Green energy will save the world trillions of dollars

▪ Frequent smartphone use harms the spine

▪ Solar energy from under the asphalt

▪ Copolymers will increase HDD capacity by 5 times

▪ Aquantia Multi-Gig Ethernet Chips for Self-Driving Vehicles

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Firmware. Article selection

▪ Fence repair article. Tips for the home master

▪ article How long can a chicken live without a head? Detailed answer

▪ article Water bike. Personal transport

▪ article Voltage stabilizer for a car battery. Encyclopedia of radio electronics and electrical engineering

▪ article The cards held by the spectators are reversed. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024