ME 305 Group 6 Documentation
|
On button activation, cycles through Square, Sinewave, and Sawtooth blink pattern. More...
Functions | |
def | led_blinks.main () |
Upon button activation, cycles through Square, Sine, and Sawtooth blink patterns. More... | |
def | led_blinks.squarePattern (t) |
Outputs the value of a square wave pattern dependent on t. More... | |
def | led_blinks.sinePattern (t) |
Outputs the value of a sine wave pattern dependent on t. More... | |
def | led_blinks.sawtoothPattern (t) |
Outputs the value of a sawtooth wave pattern dependent on t. More... | |
def | led_blinks.onButtonPressCallback (IRQ_src) |
The callback function triggered by the physical button press. More... | |
On button activation, cycles through Square, Sinewave, and Sawtooth blink pattern.
When run, launches the main() function. Upon first booting/run, the program waits to receive the first button press input. While waiting, the LED output is off. After the first button press, the program will cycle through Square, Sine, and Sawtooth wave blink patterns. Each time a new pattern is activated, it will restart the pattern from the beginning. To quit the program while running, press the Keyboard Interrupt.
For more information on how the program is structured and runs, review the diagrams below.
def led_blinks.main | ( | ) |
Upon button activation, cycles through Square, Sine, and Sawtooth blink patterns.
Upon first run, the program waits to receive the first button press input. After the first button press, the LED output will cycle through a Square, Sine, and Sawtooth blink pattern on each press of the input button.
None |
def led_blinks.onButtonPressCallback | ( | IRQ_src | ) |
The callback function triggered by the physical button press.
Sets buttonPressed flag to True.
When the physical input button is pressed on the device, this callback function sets the global buttonPressed flag to True
IRQ_src | The interrupt Source Register. Not used by this function, but contains the register responsible for the interrupt. |
def led_blinks.sawtoothPattern | ( | t | ) |
Outputs the value of a sawtooth wave pattern dependent on t.
From a value t (ticks in ms) from the initial wave activation, the function returns an output value equal to the amplitude of a sawtooth wave at the given time t. The square wave cycle has a period of 1 second, and an amplitude of 100. The sawtooth pattern increases at a rate of 100 per second, and resets each time it reaches the peak of 100.
t | The number of ticks in miliseconds since the start (or zero point) of the pattern. |
def led_blinks.sinePattern | ( | t | ) |
Outputs the value of a sine wave pattern dependent on t.
From a value t (ticks in ms) from the initial wave activation, the function returns an output value equal to the amplitude of a sine wave at the given time t. The sine wave cycle has a period of 10 seconds, and a peak-to-peak amplitude of 100 with an offset of +50.
t | The number of ticks in miliseconds since the start (or zero point) of the pattern. |
def led_blinks.squarePattern | ( | t | ) |
Outputs the value of a square wave pattern dependent on t.
From a value t (ticks in ms) from the initial wave activation, the function returns an output value equal to the amplitude of a square wave at the given time t. The square wave cycle has a period of 1 second, and an amplitude of 100.
t | The number of ticks in miliseconds since the start (or zero point) of the pattern. |