This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:exercises:digi [2010/02/07 09:29] – priitj | en:exercises:digi [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exercises ====== | ====== Exercises ====== | ||
- | The goal is to make a program | + | The goal is to write a program |
===== Warm up exercise ===== | ===== Warm up exercise ===== | ||
- | *If pressing S1 it one LED is lighted, pressing S2 two LED-s and S3 three LED-s. | + | *By pressing S1 one LED is lit, pressing S2 two LEDs and S3 three LEDs lit. |
===== For beginners ===== | ===== For beginners ===== | ||
- | - It simulates traffic light when the button is pressed. Until no button is pressed the yellow light is blinking (traffic light in night mode). After pressing a random button the traffic light starts working in everyday mode, lighting yellow, then red and before continuing | + | - This simulates |
- | - Counts | + | - This counts |
- | - By pressing switch S1, LED1 and LED3 are lighted, | + | - By pressing switch S1, LED1 and LED3 are lit; pressing S2 yellow LED is lit, pressing S3 all LEDs are switched off. This operation must be done by directly |
- | - Counts | + | - This counts |
- When pushing button S1, red LED will blink “SOS” in Morse. By pressing S2, yellow LED blinks “CQD” and by pressing S3, green will blink “OK”. | - When pushing button S1, red LED will blink “SOS” in Morse. By pressing S2, yellow LED blinks “CQD” and by pressing S3, green will blink “OK”. | ||
===== For advanced ===== | ===== For advanced ===== | ||
- | - Igale nupule kolmest vastab üks LED, mis süttib nuppu all hoides. Süütamiseks või kustutamiseks tuleb kasutada registreid ja teha võib seda ainult ühe omistamistehtega | + | - For each of the three buttons corresponds one LED which lights up when the button is pressed. For turning on or off, registers must be used and only one assigning operation |
- | - Vajutades nuppe järjekorras S3 – S2 - S1, süttib roheline | + | - For each of the three buttons corresponds one LED which lights up when the button is pressed. For turning on or off, registers must be used and only one assigning operation (hint: use bit shifts). |
- | - Igale LED-ile vastab üks nupp. Kontroller vilgutab LED-e suvaliselt ja kasutaja peab nuppe vajutades sama jada kordama. Vilkumiste jada läheb iga korraga järjest pikemaks, lisades eelnevale jadale uue suvalise | + | - There is one button for each LED. The controller blinks LEDs randomly and the user has to repeat the same sequence. The sequence of blinks gets longer – one random |
- | - Programm mõõdab reaktsiooniaega. Suvalise | + | - The program measures time for reaction. A random |
- | ===== Kordamisküsimused | + | ===== Questions |
- | - Mis on tehete "=" ja "==" erinevus? Esitage selle erinevuse tõestuseks kaks näidet. | + | - What is the difference between operations”=” and”==” ? Give two examples to verify the statement. |
- | - Mis on tehete "|" ja "||" erinevus? Esitage selle erinevuse tõestuseks kaks näidet. | + | - What is the difference between operations “|” and “||”? Give two examples to verify the statement. |
- | - Kirjutage avaldis, milles kasutate võrrandit "x = x + 1" kaksteist korda. | + | - Write an expression using the equation “x = x + 1” twelve times. |
- | - Kuidas kirjutate | + | - How an endless loop is written in C-programming language? Provide two different examples. |
- | - Millist tüüpi muutuja valite | + | - What type of a variable do you choose in C–language to present positive values between |
- | - Milline | + | - Witch register |
- | - Milliste meetoditega saab elimineerida nupu värelust? Tooge näiteid riistvaralise ja tarkvaralise lahenduse kohta. | + | - What are the methods for eliminating the bouncing of the contacts and the false connections caused by flickering? Provide examples of solutions using both hardware and software. |
- | - Mida tähendab termin bitinihutus? Tooge praktiline näide koos seletusega. | + | - What is bit shift? Give a practical example with an explanation. |
- | - Miks kasutatakse lülitite juures //pull-up//-takistit? Mille järgi määratakse selle takistus? | + | - Why are pull-up |
- | - Arvutage | + | - Calculate the resistance for regulating |