Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <mbed.h>
- DigitalOut led(LED1);
- Ticker heartbeat_interrupt;
- /**
- * @brief Simple heartbeat function.
- */
- void heartbeat(){
- led = !led;
- }
- int main()
- {
- heartbeat_interrupt.attach(&heartbeat, 1.0); // the address of the function to be attached (heartbeat) and the interval (1 seconds)
- while(1){
- sleep();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement