Difference: ExerciseSheets (5 vs. 6)

Revision 62022-10-16 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="ASP2022"

Exercises

Line: 67 to 67
 

End of the second exercise session

Added:
>
>

Programming the user LED on the CPU card

 
Changed:
<
<
-- Uli Raich - 2022-10-14
>
>
Write a program that blinks the user programmable LED on the CPU card at a frequency of 1 Hz (500 ms on, 500 ms off)

Write a function that blinks the LED once with a delay that is passed as a parameter:

def blink_once(delay): 

Test the function with a main program calling is with different delays.

Use the function to implement a program that blinks an SOS: 3 short pulses, followed by 3 long pulses, followed by 3 short pulses, followed by a 2s pause. You may use a 200 ms delay for the short pulses and 700 ms delay for the long ones.

Reading the pushbutton

Write a program that reads the push button state ever 100 ms and prints its state (pressed or released)

Improve the program printing the state only when there was a state change.

# Session 4

Reading an analogue signal level from the slider potentiometer

-- [[Main.U][ U liRaich -

2022-10-14]]

 

Comments

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback