Electronic clock with one digit. We measure time. Clock Clock diagram with one digit

Electronic watches with a wide variety of functionality are one of the most widely used electronic devices in everyday life, the control of which is based on a finite-state machine model. Electronic watches usually show the time, date, allow you to set the time and date, and also perform many other functions (for example, they can be turned into a stopwatch with reset and stop, an alarm clock, etc.). All these capabilities are controlled by a built-in finite-state-automatic converter, the inputs of which are events of pressing external control buttons. Structural scheme electronic clock is shown in Fig. 3.11. The control buttons are designated here as “a” and “b”. In addition to the display device that displays the digits and the display circuit that converts the BCD codes of the digits into a seven-digit LED control code, the diagram shows four display registers storing the BCD codes of the four digits that are currently displayed on the dial using the circuit and device displays, “OR” combinational circuits that pass any of the allowed codes to the display registers, the “Control” bus, which allows in each situation the output of only stopwatch, clock, or date signals to the display registers. The circuit also contains stopwatch registers and a tick generator that produces a signal with a frequency of 1 Hz. The figure captures the moment “June 19, 15 hours 04 minutes, 43 seconds.”

Fig.3.11. Block diagram of an electronic clock

The control device that organizes the operation of all elements of the electronic watch is built on the basis of a finite state machine model. The transition graph of this automaton is shown in Fig. 3.12. In the initial state, the time is displayed. This means that the binary code of this state (after decoding) opens the outputs of four binary-decimal registers storing units and tens of minutes and units and tens of hours to the inputs of four combinational “OR” circuits.

Fig.3.12. Automatic electronic clock control device

State machine reacts to the event of pressing the “a” button on the watch body by transitioning to the “state” Setting the minutes”, in which the event of pressing the “b” button will cause the number stored in the registers allocated for minutes to increase. In this case, transfers from the seconds register and to the register reserved for storing numbers are blocked. Event of pressing button “b” in state “ Est. months” will cause the number stored in the registers allocated for the month to increase. In Fig. 3.12 does not show the possibility and algorithm of working with a stopwatch.

The industry produces many types of electronic watches with different functionality. Control circuits for such clocks can be constructed if you have the skill to implement finite functional converters and construct finite-automatic models of discrete control systems.

I fixed the digital clock. This is unrealistically cool, considering that I have never been an electronics expert. This is the first time in my life. The problem was that they began to turn off when the alarm went off. I thought that the air conditioner had lost its air quality. Despite the move, I still have the air conditioners soldered from some old circuit board. The legs were correspondingly very short. I added wires. Soldered it parallel to the old one and it worked. Interestingly, there was space on the board just for one more air conditioner.

General form:

But the green barrel is what I soldered:

Works great.

For one thing I decided to experiment. I recently learned about dynamic indicators. It means that glowing indicators Many devices do not light up constantly all the time, but blink continuously, because it is cheaper and there are fewer wires. (This does not apply to liquid crystals. They do not burn at all, they are filters, and the light bulb under them glows.) It’s interesting how this affects the nervous system... To check, you can photograph some kind of display at a short shutter speed several times and there all the confusion will become visible. On this watch it became visible already at 1/150 shutter speed.





In case anyone doesn’t understand: I was filming a perfectly serviceable watch. No matter how closely you look, it is impossible to see any flickering with the naked eye. We set the shutter speed to 1/25 - everything becomes normal:

And everything looks fine with the eyes too. This is how indicators fool us. All.

Before the first clocks were invented, people measured time by watching the sun. In the morning, the sun rises above the horizon on one side, then crosses the sky to the opposite side and sets below the horizon. The next morning the same thing happens.

The time it takes for the sun to make a full revolution is called day. Days turn into weeks. Weeks into months. Months into years. Years into centuries.

In one century there are 100 years.

One year has 12 months.

There are 30 or 31 days in one month.

Over time, the day was divided into two parts before noon and after noon. Each part was divided into 12 parts - hours. That's why there are 12 divisions on the clock. There are only 24 hours in a day.

Let's look at the clock. Bold lines and numbers here indicate the hours; there are 12 of them on the clock. A small hand points to the hours. During the day, the small hand makes two revolutions of 12 hours. Slowly the small hand moves from hour to hour.

The hour is divided into 60 parts - minutes. That is, 1 hour 60 minutes.

The watch dial is divided into 60 parts (one division - one minute). The large hand indicates the minutes. When the large hand makes one revolution, an hour passes and the small hand advances 1 hour.

The countdown starts at 12. At midnight - 0 hours 0 minutes or 12 o'clock at night.

When the small hand makes a full revolution, 12 hours will pass and it will be 12 o'clock - noon.

On an electronic watch, time is displayed in numbers, for example, 1 o'clock in the morning will be displayed like this:

AM (Latin ante meridiem - before noon), means that the displayed time is in the range from midnight to noon or from 0 to 12 hours.

After 12 o'clock the countdown continues. In an hour it will be 13 hours or 1 hour after noon, then 14 (or 2 hours after noon):

PM (lat. post meridiem - after noon) - the displayed time is in the range from noon to midnight, that is, from 12 noon to 12 night or from 12 to 24 hours

The minute hand makes a circle in one hour. One division – 1 minute. When the minute hand points to 1 it's 5 minutes, 2 is 10 minutes, 3 is 15 minutes and so on until the minute hand makes a full circle and returns to 12 to 60 minutes:

Let's create a table of hours during the day:

00:00 AM

01:00 AM

02:00 AM

03:00 AM

04:00 AM

05:00 AM

06:00 AM

07:00 AM

08:00 AM

09:00 AM

10:00 AM

11:00 AM

12:00 PM

01:00 PM

02:00 PM

03:00 PM

04:00 PM

Probably no device is as susceptible to all sorts of changes and unusual incarnations as an ordinary watch. Starting with solar and ending with atomic ones - and how many different variations there are between them... Periodically posting especially interesting diagrams and designs from foreign sources, and this time we will introduce you to another device for displaying the current time, which is not only on an old domestic vacuum indicator, there is also only one number.

Single digit clock diagram

This clock uses a PIC16F84A microcontroller. The circuit is quite simple, since it uses a single indicator controlled by transistors and does not require a very powerful power converter.

The lamp they used was a Soviet IN-12A. The high voltage supply is obtained using components from a cheap (non-working) digital camera, so it costs almost nothing.

The watch displays time in such a way that periodically the indicator numbers change from tens of hours to minutes. Then they go out for a few seconds. For example, to show the time 12:45 , will first light up for a second 1 , Then 2 , Then 4 , Then 5 . And a few seconds pause.

To set the time, you need to press the button, and then the number you want to change will increase each time you press, and so on in a circle from 0 to 9.

The main board contains all components except the high voltage power conversion module. All files of boards, firmware, etc. are located in a common archive. Components required for the circuit:

  • IN-12 indicator
  • MK PIC16F84A
  • 10x high voltage SMD transistors MMBTA42
  • 13x 0805 resistors
  • Quartz 4 MHz
  • 2x 22pF capacitors
  • Button

The high voltage converter, as mentioned above, uses components removed from the camera flash - a transformer, a diode and an output capacitor.

If you decide to collect this watch, remember that it uses high voltage- up to 400 V. Be careful during assembly and operation!

To program the code into the PIC, you will need a programmer and software for him. Here we used a Chinese k150 programmer. You need to load the .hex file into the program and burn the MK chip.

Question: Problem. Electronic clocks based on simple arithmetic operations


Hello, forum users!
Help me with this problem, please >_<
Task:
Electronic watches show time in the h:mm:ss format, that is, first the number of hours is recorded, then a two-digit number of minutes is required, then a two-digit number of seconds is required. The number of minutes and seconds, if necessary, is padded to a two-digit number with zeros.

N seconds have passed since the beginning of the day. Print what the clock will show.
Input data
Enter an integer n.

Output
Print the answer to the problem, following the required format.

Examples
input data
3602
output
1:00:02

Here's what I got:

Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 import ; import javax.swing.plaf.synth.SynthOptionPaneUI; import java.util.Scanner ; public class quest ( public static void main(String args) ( Scanner in = new Scanner (System .in ) ; long n,h,m,s; n = in.nextLong () ; h = (n % (3600 * 24 ) ) /3600 ; m = (n % 3600 ) / 60 ; s = (n % 60 ) ; if (m< 10 ) { if (s< 10 ) { System .out .println (h+ ":0" +m+ ":0" +s) ; } else if (s>10 ) ( System .out .println (h+ ":0" +m+ ":" +s) ; ) ) else if (m> 10 ) ( if (s< 10 ) { System .out .println (h+ ":" +m+ ":0" +s) ; } else if (s>10 ) ( System .out .println (h+ ":" +m+ ":" +s) ; ) ) ) )

This solution is not correct in all cases, although I don't understand why =c
Help me find the problem, I will be grateful!

Answer:

Java
1 2 3 int i = 3602 ; LocalTime time = LocalTime.MIDNIGHT .plus (i, SECONDS) ; System .out .println (time) ;

Question: Electronic clock with alarm clock Delphi


Friends, we need to defend our practice, we were given the task of an electronic watch with an alarm clock, who will help or throw it off?)
I will be very, very grateful)

Added after 1 minute
friends, preferably with wording)

Answer:

Message from anegdot

Electronic watch turns out

Let's look at your watch and what's not working there.


Input data

Output





Python
1 2 3 4 5 6 7 8 9 n = int (input()) if n< 1440 : print (n//60 ) print (n%60 ) else : a = 1440 - n a *= -1 print (a//60 ) print (a%60 )

Answer: Can be solved without conditions:

Question: Electronic watches


It is necessary to develop a program that implements an electronic clock. The numbers are implemented graphically through a set of rectangles, and not in text form.
Required interface elements: main menu bar, Shape elements, or using the Canvas property to draw numbers and control buttons.

Answer: xxbesoxx, not so simple. Task

Message from Kapetra

Numbers are implemented graphically through a set of rectangles, and not in text form

Kapetra,

P.S. if you look carefully at the topic, you will find a lot of interesting things

Question: Problem about electronic watches


The number n is given. n minutes have passed since the beginning of the day. Determine how many hours and minutes the digital clock will show at this moment.

Input data
Enter the number n - an integer, positive, not exceeding 10 to the seventh power.

Output
The program should output two numbers: the number of hours (from 0 to 23) and the number of minutes (from 0 to 59).

Please note that n can be greater than the number of minutes in a day.
__________________________________________________________________________________________
my solution, help me find the error.
___________________________________________________________________________________________

Python code
1 2 3 4 5 6 7 8 9 n = int (input()) if n< 1440 : print (n//60 ) print (n%60 ) else : a = 1440 - n a *= -1 print (a//60 ) print (a%60 )

Answer:

Message from Andrey_Goa

Find out the number of days

Why is this? The number of days will not be needed anywhere, only the remainder of the division

Python code
1 2 hours = (n % 1440 ) // 60 mins = (n % 1440 ) % 60

Question: "Electronic watches"


The task itself: “The electronic clock shows time in the h:mm:ss format, that is, first the number of hours is written down, then a two-digit number of minutes is required, then a two-digit number of seconds is required. The number of minutes and seconds, if necessary, is supplemented to a two-digit number with zeros.
N seconds have passed since the beginning of the day. Print what the clock will show."
Link to it: .
Pascal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Program Time2; var a, n: Integer ; Begin Readln (n) ; If n= 0 then Writeln ("00" , ":" , "00" , ":" , "00" ) else If (n<3600 ) and ((n div 60 ) <10 ) and ((n mod 60 ) <10 ) then Writeln ("00:0" , n div 60 , ":0" , n mod 60 ) else If (n<3600 ) and ((n div 60 ) >= 10 ) and ((n mod 60 ) >= 10 ) then Writeln ("00:" , n div 60 , ":" , n mod 60 ) else If (n<86400 ) and (n>3600 ) and ((n div 3600 )<10 ) and (((n mod 3600 ) div 60 ) <10 ) and (((n mod 3600 ) mod 60 ) <10 ) then Writeln ("0" , n div 3600 , ":0" , (n mod 3600 ) div 60 , ":0" , (n mod 3600 ) mod 60 ) else If (n<86400 ) and (n>3600 ) and ((n div 3600 ) >= 10 ) and (((n mod 3600 ) div 60 ) >= 10 ) and (((n mod 3600 ) mod 60 ) >10 ) then Writeln (n div 3600 , " :" , (n mod 3600 ) div 60 , ":" , (n mod 3600 ) mod 60 ) else If (n mod 86400 = 0 ) then Writeln ("00" , ":" , "00" , ":" , "00" ) else a: = n mod 86400 ; If (n>86400 ) and ((a div 3600 ) >= 10 ) and (((a mod 3600 ) div 60 ) >= 10 ) and (((a mod 3600 ) mod 60 ) >= 10 ) then Begin ( a:=n mod 86400;) Writeln (a div 3600 , ":" , (a mod 3600 ) div 60 , ":" , (a mod 3600 ) mod 60 ) end else If (n>86400 ) and ((a div 3600)<10 ) and (((a mod 3600 ) div 60 ) <10 ) and (((a mod 3600 ) mod 60 ) <10 ) then Writeln ("0" , a div 3600 , ":0" , (a mod 3600 ) div 60 , ":0" , (a mod 3600 ) mod 60 ) end .

The problem is that until I started trying to make it output in the “correct” format, everything was fine. It gave out for any given numbers, tested 30 options. I started to suffer with these zeros, which should appear before minutes or seconds, if there are less than 10 of them and everything went to hell. Now the program works correctly only on certain numbers, and I haven’t been able to figure out the “triggering” algorithm yet. For most numbers, the program simply does not produce anything. It would be nice if it would at least show some errors, but no, just a blank screen.
Does this method of “correct” writing through “If” even have a right to life?
Here is the original version, where everything was issued in the wrong format, but essentially correct

Pascal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Program Time2; var a, n: Integer ; Begin Readln (n) ; If n= 0 then Writeln ("00" , ":" , "00" , ":" , "00" ) else If n<86400 then Writeln (n div 3600 , ":" , (n mod 3600 ) div 60 , ":" , (n mod 3600 ) mod 60 ) else If n mod 86400 = 0 then Writeln ("00" , ":" , "00" , ":" , "00" ) else If n>86400 then Begin a: = n mod 86400 ; Writeln (a div 3600 , ":" , (a mod 3600 ) div 60 , ":" , (a mod 3600 ) mod 60 ) ; end end .

And in what case is the program generally “simply silent”?

Answer:

Pascal
1 2 3 4 5 6 7 8 9 10 11 12 var n: Longint ; h, m, s: Integer ; begin ReadLn (n) ; h: = n div 3600 mod 24 ; m: = n mod 3600 div 60 ; s: = n mod 3600 mod 60 ; Write (h, ":" ) ; if m<10 then Write ("0" ) ; Write (m, ":" ) ; if s<10 then Write ("0" ) ; WriteLn (s) ; end .

Question: Electronic clock with alarm clock


Hi people! Please help me figure out the problem. There are electronic clocks that show real time. You need to place 3 buttons on the form: "H", "M", "A". Button
“H” (Hours) increases the number of hours by one, and the “M” (Minutes) button increases the number of minutes. The increase occurs modulo 24 and 60, respectively. Such clocks have simple behavior, since each of the two input actions (pressing the first or second button) leads to a single, predetermined
certain reaction of the clock. The additional button “A” (Alarm) is designed to turn the alarm clock on and off. If the alarm clock is turned off, then the “A” button turns it on and puts the clock into mode
in which the “H” and “M” buttons set not the current time, but the response time
alarm clock Pressing the “A” button again returns the watch to normal mode. Moreover, all this should be done using automatic programming. Here's the project:
But the teacher gave a listing of the program, but only in C++. Please help, maybe someone has done something similar. Maybe it can be remade somehow.
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 classAlarm_Clock( public : voidh_button() //Pressing the H button( if (is_in_alarm_time_mode) ( alarm_hours= (alarm_hours+ 1 ) % 24 ; ) else ( hours= (hours+ 1 ) % 24 ; ) ) voidm_button() //Button pressM ( if (is_in_alarm_time_mode) ( alarm_minutes= (alarm_minutes+ 1 ) % 60 ; ) else ( minutes= (minutes+ 1 ) % 60 ; ) ) voida_button() //Press button A( if (is_alarm_on) ( if (is_in_alarm_time_mode) ( is_in_alarm_time_mode= false ; ) else ( bell_off() ; is_alarm_on= false ; ) ) else ( is_alarm_on= true ; is_in_alarm_time_mode= true ; ) ) voidtick() //Trigger the minute timer( if (is_alarm_on&&! is_in_alarm_time_mode) { if(( minutes == alarm_minutes1 ) && ( hours == alarm_hours ) || ( alarm_minutes == 0 ) && ( minutes == 59 ) && ( hours == alarm_hours1 ) ) bell_on () ; elseif (( minutes == alarm_minutes ) && ( hours == alarm_hours ) ) bell_off () ; } minutes = ( minutes + 1 ) % 60 ; if( minutes == 0 ) hours = ( hours + 1 ) % 24 ; } private: inthours ; //Clock current time intminutes ; //Minutes of current time intalarm_hours ; //Alarm clock intalarm_minutes ; //Minute for the alarm to go off boolis_alarm_on ; //Is the alarm on? boolis_in_alarm_time_mode ; //Is alarm time setting mode active? voidbell_on () { ...} //Enable call voidbell_off () { ...} //Turn off the call } ;