A Jedi light saber controller program with the following "features": - Using RGB LEDs - User can change light colors with a button - Motion dependent (PWM) sounds with a MPU6050 motion sensor - Low voltage detection

Dependencies:   L152RE_USBDevice STM32_USB48MHz Watchdog mbed

LightSaber_sounds.h

Committer:
nightmechanic
Date:
2016-03-26
Revision:
4:7e4bb0c29d3b
Parent:
0:0bb3687e39da

File content as of revision 4:7e4bb0c29d3b:

#define STARTUP_SOUND       1
#define MOVEMENT_SOUND      2
#define CLASH_SOUND         3

#define INIT_VOL_IDX        0
#define STEP_VOL_IDX        1
#define INIT_PERIOD_IDX     2
#define STEP_PERIOD_IDX     3
#define STEP_DUR_IDX        4
#define NUM_STEPS_IDX       5

#define STARTUP_TBL_N_LINES  6
#define MOVEMENT_TBL_N_LINES 4
#define CLASH_TBL_N_LINES 3

const int startup_sound_table[][6] = {
// initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps
    {50, -5,  20000,  -250, 20,   5},
    {25, 0,  18500,  -250, 20,   30},
    {25, -5,  11000,  0,    20,   3},
    {10, 0,  11000,  0,    100,  1},
    {15, 3, 11250,  250,  20,   11},
    {50,  0, 14000,  0,    20, 1}
    };

const int movement_sound_table[][6] = {
// initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps
    {25, 0,  14000,  250,  40,   15},
    {25, 0,  18000,  -250, 40,   19},
    {25, 0,  13000,  250,  40,   4},
    {50, 0,  14000,  0,    20, 1}
    };
    
const int clash_sound_table[][6] = {
// initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps
    {10, 0,  10000,  0,  200,   1},
    {10, 2,  10000,  250, 40,   15},
    {50, 0,  14000,  0,    20, 1}
    };