Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercises | ||||||||
Line: 81 to 84 | ||||||||
tp_10 is the trajectory for 10 degrees. | ||||||||
Changed: | ||||||||
< < | tp_45 is the trajectories for 45 degrees. | |||||||
> > | tp_45 is the trajectory for 45 degrees. | |||||||
End of the second exercise session | ||||||||
Line: 91 to 94 | ||||||||
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: | ||||||||
Added: | ||||||||
> > | ||||||||
def blink_once(delay): | ||||||||
Changed: | ||||||||
< < | Test the function with a main program calling is with different delays. | |||||||
> > | Test the function with a main program calling it 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 | ||||||||
Line: 102 to 106 | ||||||||
Improve the program printing the state only when there was a state change. | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Forth exercise sessionReading an analogue signal level from the slider potentiometer
| ||||||||
Line: 120 to 124 | ||||||||
You can further modify the colors by changing the intensity values. For example: (12,27,5) Play around trying to generate as many different colors as you like. | ||||||||
Changed: | ||||||||
< < | Write a program that lights the top LED in blue and then lights the following LEDs in clockwise direction to :
| |||||||
> > | You may have a look at the small project below and light the LEDs in the colors required by the project. | |||||||
A small projectAs a small project, we are going to combine the reading of the ADC and the control of the rgb LED ring. As we saw, the ADC delivers values between 0 and 4095 (12 bits). We can divide this range in 7 slices, corresponding to the 7 LEDs in the ring. For the lowest slice, the top LED will be lit. Then we go clockwise around the ring: the next LED lit will be to the right of the first one. For the highest slice, the middle LED will be lit. | ||||||||
Line: 158 to 156 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|