ELEC2645 (2015/16) / Mbed 2 deprecated Main_code_ver18

Dependencies:   FATFileSystem N5110_mod SDFileSystem USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

general

general

General purpose variables and functions. More...

Namespaces

namespace  bool_to_int
 

converts boolean array to integer


namespace  selector
 

selects value between 0 and 7 based on step button press


Functions

AnalogOut SOUND_OUT_1 (DAC0_OUT)
 # IO
void init ()
 trigger channels
void IO_init ()
 initialises general IO
int bool_to_int (bool *array, int shifter)
void selector (bool *flag, int *variable)
void check_flags ()
 checks interrupt flags

Detailed Description

General purpose variables and functions.


Function Documentation

int bool_to_int ( bool *  array,
int  shifter 
)

1:1 mapping

even mapping

odd mapping

Definition at line 53 of file main.cpp.

void check_flags (  )

checks interrupt flags

increments sequencer if flag is set

clears midi messages if decay flag is set

clears trigger outputs if decay flag is set

detatches decay ticker

clears decay flag

run if any input buttons are pressed

prints button values over serial if available, for debugging

toggles shift LED

clears shift button flag

toggles instrument selection, and updates LCD & serial

toggles pattern selection, and updates LCD & serial

selects current instrument if inst_flag is set

selects current pattern if pattern_flag is set

otherwise, updates sequence data

writes sequence data & position indicator to matrix

stores current instrument, in order to return once skip setting is complete

sets sequencer channel to skip channel

returns to previous instrument

updates LED output

re-draws display

toggles sequencer ticker

draws main menu

draws edit menu

loads sequence from SD card

saves sequence to SD card

clears button press flag

runs tempo_set routine if button is pressed

Definition at line 79 of file main.cpp.

void init (  )

trigger channels

# functions initialises system

Definition at line 33 of file main.cpp.

void IO_init (  )

initialises general IO

test trigger outputs

Definition at line 44 of file main.cpp.

void selector ( bool *  flag,
int *  variable 
)

scans through input button values

sets value if button is pressed

set display to normal

Definition at line 66 of file main.cpp.

AnalogOut SOUND_OUT_1 ( DAC0_OUT   )

# IO

speaker output