A first try to test how interrupt, timeout and ticker interact.
Dependencies:
mbed
« Back to documentation index
Test
Main module to test led, button and ticker interaction.
More...
Functions
void offEnd (void)
Function called at end of offEnd timeout, sets new timeout defined by led1 state offEnd calls onEnd which calls offEnd making an oscillator.
void toggleLed1 (void)
Function to toggle led1 evry time the button is pushed this function is called and led1 state toggled.
void onEnd (void)
Function called at end of onEnd timeout, sets new timeout defined by led1 state onEnd calls offEnd which calls onEnd making an oscillator.
void rampPWM (void)
Function to manage PWM for orange LED at each new tick rampPWM is called changing PWM value ramping up and down the LED.
int main (void)
main function sets system up by initializing LEDs state attaching interrupt launching ticker and timeout then enters an infinite while(1) loop
Detailed Description
Main module to test led, button and ticker interaction.
Author: fdufnews
Date: 23.08.2014
Note: required LEDs on pin D9 and D11 in addition to that on the board
Function Documentation
main function sets system up by initializing LEDs state attaching interrupt launching ticker and timeout then enters an infinite while(1) loop
Definition at line 79 of file main.cpp .
Function called at end of offEnd timeout, sets new timeout defined by led1 state offEnd calls onEnd which calls offEnd making an oscillator.
Definition at line 45 of file main.cpp .
Function called at end of onEnd timeout, sets new timeout defined by led1 state onEnd calls offEnd which calls onEnd making an oscillator.
Definition at line 37 of file main.cpp .
Function to manage PWM for orange LED at each new tick rampPWM is called changing PWM value ramping up and down the LED.
Definition at line 53 of file main.cpp .
Function to toggle led1 evry time the button is pushed this function is called and led1 state toggled.
Definition at line 31 of file main.cpp .