ELEC2645 (2015/16) / Mbed 2 deprecated Main_code_ver18

Dependencies:   FATFileSystem N5110_mod SDFileSystem USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Tap tempo

Tap tempo

Variables and functions used to control the tap-tempo. More...

Functions

InterruptIn tempo_tapIn (PTB9)
 interrupt for tap tempo button
void tempo_init ()
 # functions
void tempo_ISR ()
 interrupt called by tap tempo input
void tempo_set ()
 tempo set routine
void tempo_update ()
 Indicates tempo to be updated (used when tempo is set via menu)

Variables

Timer tempo_time
 # IO & interrupts
volatile int tempo_flag
 # flags & variables
int tempo_timerState
 indicates how many times tap tempo button has been pressed
float tempo_debounce = 0
 keeps track of button bounces
volatile int tempo_update_flag = 0
 indicates that tempo has been changed

Detailed Description

Variables and functions used to control the tap-tempo.


Function Documentation

void tempo_init (  )

# functions

initialises tap tempo

attach tap input to ISR

start timer

Definition at line 387 of file main.cpp.

void tempo_ISR (  )

interrupt called by tap tempo input

Definition at line 392 of file main.cpp.

void tempo_set (  )

tempo set routine

First press (timer start)

to prevent false triggers

reset and restart timer

Increment state variable

Second press (count)

to prevent false triggers

Increment state variable

Third press (count)

to prevent false triggers

Increment state variable

Fourth press (Stop timer & set tempo)

to prevent false triggers

Stop timer

update tempo

reset tempo timer

Reset state variable

Definition at line 396 of file main.cpp.

InterruptIn tempo_tapIn ( PTB9   )

interrupt for tap tempo button

void tempo_update (  )

Indicates tempo to be updated (used when tempo is set via menu)

Definition at line 446 of file main.cpp.


Variable Documentation

float tempo_debounce = 0

keeps track of button bounces

Definition at line 359 of file main.h.

volatile int tempo_flag

# flags & variables

set when tap tempo button is pressed

Definition at line 355 of file main.h.

Timer tempo_time

# IO & interrupts

timer to keep track of time between button presses

Definition at line 348 of file main.h.

indicates how many times tap tempo button has been pressed

Definition at line 357 of file main.h.

volatile int tempo_update_flag = 0

indicates that tempo has been changed

Definition at line 361 of file main.h.