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@4:7e4bb0c29d3b, 2016-03-26 (annotated)
- Committer:
- nightmechanic
- Date:
- Sat Mar 26 21:36:24 2016 +0000
- Revision:
- 4:7e4bb0c29d3b
- Parent:
- 0:0bb3687e39da
Added source info to the MPU6050 files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nightmechanic | 0:0bb3687e39da | 1 | #define STARTUP_SOUND 1 |
nightmechanic | 0:0bb3687e39da | 2 | #define MOVEMENT_SOUND 2 |
nightmechanic | 0:0bb3687e39da | 3 | #define CLASH_SOUND 3 |
nightmechanic | 0:0bb3687e39da | 4 | |
nightmechanic | 0:0bb3687e39da | 5 | #define INIT_VOL_IDX 0 |
nightmechanic | 0:0bb3687e39da | 6 | #define STEP_VOL_IDX 1 |
nightmechanic | 0:0bb3687e39da | 7 | #define INIT_PERIOD_IDX 2 |
nightmechanic | 0:0bb3687e39da | 8 | #define STEP_PERIOD_IDX 3 |
nightmechanic | 0:0bb3687e39da | 9 | #define STEP_DUR_IDX 4 |
nightmechanic | 0:0bb3687e39da | 10 | #define NUM_STEPS_IDX 5 |
nightmechanic | 0:0bb3687e39da | 11 | |
nightmechanic | 0:0bb3687e39da | 12 | #define STARTUP_TBL_N_LINES 6 |
nightmechanic | 0:0bb3687e39da | 13 | #define MOVEMENT_TBL_N_LINES 4 |
nightmechanic | 0:0bb3687e39da | 14 | #define CLASH_TBL_N_LINES 3 |
nightmechanic | 0:0bb3687e39da | 15 | |
nightmechanic | 0:0bb3687e39da | 16 | const int startup_sound_table[][6] = { |
nightmechanic | 0:0bb3687e39da | 17 | // initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps |
nightmechanic | 0:0bb3687e39da | 18 | {50, -5, 20000, -250, 20, 5}, |
nightmechanic | 0:0bb3687e39da | 19 | {25, 0, 18500, -250, 20, 30}, |
nightmechanic | 0:0bb3687e39da | 20 | {25, -5, 11000, 0, 20, 3}, |
nightmechanic | 0:0bb3687e39da | 21 | {10, 0, 11000, 0, 100, 1}, |
nightmechanic | 0:0bb3687e39da | 22 | {15, 3, 11250, 250, 20, 11}, |
nightmechanic | 0:0bb3687e39da | 23 | {50, 0, 14000, 0, 20, 1} |
nightmechanic | 0:0bb3687e39da | 24 | }; |
nightmechanic | 0:0bb3687e39da | 25 | |
nightmechanic | 0:0bb3687e39da | 26 | const int movement_sound_table[][6] = { |
nightmechanic | 0:0bb3687e39da | 27 | // initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps |
nightmechanic | 0:0bb3687e39da | 28 | {25, 0, 14000, 250, 40, 15}, |
nightmechanic | 0:0bb3687e39da | 29 | {25, 0, 18000, -250, 40, 19}, |
nightmechanic | 0:0bb3687e39da | 30 | {25, 0, 13000, 250, 40, 4}, |
nightmechanic | 0:0bb3687e39da | 31 | {50, 0, 14000, 0, 20, 1} |
nightmechanic | 0:0bb3687e39da | 32 | }; |
nightmechanic | 0:0bb3687e39da | 33 | |
nightmechanic | 0:0bb3687e39da | 34 | const int clash_sound_table[][6] = { |
nightmechanic | 0:0bb3687e39da | 35 | // initial_volume[%], vollume_step, initial_period[us], period_step, duration[ms], num_of_steps |
nightmechanic | 0:0bb3687e39da | 36 | {10, 0, 10000, 0, 200, 1}, |
nightmechanic | 0:0bb3687e39da | 37 | {10, 2, 10000, 250, 40, 15}, |
nightmechanic | 0:0bb3687e39da | 38 | {50, 0, 14000, 0, 20, 1} |
nightmechanic | 0:0bb3687e39da | 39 | }; |