Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:exercises:digi [2010/02/07 09:29] priitjen: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 witch is able to perform specified task.+The goal is to write a program which is able to perform tasks described below.
  
 ===== 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 again yellow +  - This simulates manually operated traffic light at pedestrian crossing. Until no button is pressed a green LED is lit for the cars. After pressing a random button the green LED will start to blink for 3 secondsthis is followed by lighting the yellow LED for 3 seconds and red for 10 seconds, after this sequence a green LED is lit again 
-  - Counts how many times the button is pressed. The pressing is considered as ended after the button is released. The result is displayed is binary code on LED-s. Maximum result when using three LED-s is 7(23-1). Green is 1. bit, yellow 2. bit and red 3. bit. +  - This counts how many times the button is pressed. Only the full release of the button will complete the pressing. The result is displayed in binary code on LEDs. Maximum result for three LEDs is 7(23-1). Green marks 1. bit, yellow 2. bit and red 3. bit. 
-  - By pressing switch S1, LED1 and LED3 are lighted, pressing S2 yellow LED is lighted, pressing S3 all LED-s are switched off. This operation must be done by changing directly values of corresponding registers (without using the library of the home lab). +  - 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 changing the values of corresponding registers (without using the library of the HomeLab). 
-  - Counts how many times the button is pressed. The result is displayed by blinking LED-s. After every press the number of blinking is raised by one. Random button may be selected. Blinking the LED sub function witch’s parameter is the number of blinks must be used.+  - This counts how many times the button is pressed. The result is displayed by blinking of the LEDs. After each pressing the number of blinking is increased by one. A random button can be selected. In order for the LED to blink a sub function must be used, with parameters set on the number of blinks.
   - 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 hoidesSüütamiseks või kustutamiseks tuleb kasutada registreid ja teha võib seda ainult ühe omistamistehtega (vihjekasutada bitinihutust). +  - For each of the three buttons corresponds one LED which lights up when the button is pressedFor turning on or off, registers must be used and only one assigning operation (hintuse bit shifts). 
-  - Vajutades nuppe järjekorras S3 – S2 - S1, süttib roheline LED. Kõigi teiste kombinatsioonide korral süttib punane LED. Iga nupuvajutuse korral vilgatab kollane LEDmis kinnitab nupule vajutust+  - For each of the three buttons corresponds one LED which lights up when the button is pressedFor turning on or offregisters must be used and only one assigning operation (hint: use bit shifts)
-  - Igale LED-ile vastab üks nuppKontroller vilgutab LED-e suvaliselt ja kasutaja peab nuppe vajutades sama jada kordamaVilkumiste jada läheb iga korraga järjest pikemaks, lisades eelnevale jadale uue suvalise LED. Pärast iga kasutaja sisestuskorda kontrollitakse, kas sisestus oli õigeSisestuste vahe on kaks sekunditVale sisestuse korral vilgutatakse kõiki tulesid korraga kolm korda. (Mängija õigete sisestuste arvu võib kuvada LCD ekraanil. +  - There is one button for each LED. The controller blinks LEDs randomly and the user has to repeat the same sequenceThe sequence of blinks gets longer – one random LED is added with a new roundThe sequence is controlled after each userThe time gap between each entry is two secondsIn case of  an incorrect entry all LEDs blink three times. (The number of correct entries by the user may be displayed on a LCD screen).  
-  - Programm mõõdab reaktsiooniaegaSuvalise LED süttides peab kasutaja võimalikult kiiresti vajutama nuppu LED allAeg, mil LED süttibon juhuslik, kuid vähemalt 100 ms. Reaktsiooniaega näidatakse kasutajale millisekundites LCD ekraanilNuppude väärtust ei tohi lugeda värelust filtreeriva funktsioonigasest see tekitab lisaviite.+  - The program measures time for reactionA random LED is lit and the user has to press the corresponding button as fast as possibleThe time when the LED is lit is randombut not less than 100 ms. the result is displayed on a LCD screen in millisecondsThe value of the buttons cannot be read with filtering function for the flickeringsince this will cause an extra delay.
  
-===== Kordamisküsimused =====+===== Questions =====
  
-  - Mis on tehete "=" ja "==" erinevusEsitage 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 "||" erinevusEsitage 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 C-keeles lõputu tsükli+  - How an endless loop is written in C-programming languageProvide two different examples. 
-  - Millist tüüpi muutuja valite C-keeles, et esitada positiivseid arve vahemikus kuni 154? +  - What type of a variable do you choose in C–language to present positive values between and 154? 
-  - Milline register määrab ära pordi suunaTooge pordi näide sisendi ja väljundi seadistamise kohta+  - Witch register determines the direction of a portProvide an example of configuring settings of ports’ input and output
-  - Milliste meetoditega saab elimineerida nupu värelustTooge näiteid riistvaralise ja tarkvaralise lahenduse kohta+  - What are the methods for eliminating the bouncing of the contacts and the false connections caused by flickeringProvide examples of solutions using both hardware and software
-  - Mida tähendab termin bitinihutusTooge praktiline näide koos seletusega+  - What is bit shiftGive a practical example with an explanation
-  - Miks kasutatakse lülitite juures //pull-up//-takistitMille järgi määratakse selle takistus+  - Why are pull-up resistors used in switchesHow is their resistance determined
-  - Arvutage LED voolu piirava takisti väärtuskui toitepinge on 5 V, LED päripinge 2,7 V ja vool 30 mA.+  - Calculate the resistance for regulating LED currentthe voltage is 5 V, forward voltage of the LED is 2,7 V and the current is 30 mA.
en/exercises/digi.1265534946.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0