BopIt on the mbed
Dependencies: SDFileSystem mbed wave_player
bobit.h@0:d30842e497f7, 2013-10-17 (annotated)
- Committer:
- dgobin
- Date:
- Thu Oct 17 19:58:54 2013 +0000
- Revision:
- 0:d30842e497f7
A game of bopIt on the mbed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dgobin | 0:d30842e497f7 | 1 | #include "mbed.h" |
dgobin | 0:d30842e497f7 | 2 | #include "SDFileSystem.h" |
dgobin | 0:d30842e497f7 | 3 | #include "wave_player.h" |
dgobin | 0:d30842e497f7 | 4 | |
dgobin | 0:d30842e497f7 | 5 | |
dgobin | 0:d30842e497f7 | 6 | //lights for guiding player |
dgobin | 0:d30842e497f7 | 7 | DigitalOut led1(LED1); |
dgobin | 0:d30842e497f7 | 8 | DigitalOut led2(LED2); |
dgobin | 0:d30842e497f7 | 9 | DigitalOut led3(LED3); |
dgobin | 0:d30842e497f7 | 10 | DigitalOut led4(LED4); |
dgobin | 0:d30842e497f7 | 11 | |
dgobin | 0:d30842e497f7 | 12 | //noises for guiding player |
dgobin | 0:d30842e497f7 | 13 | SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card |
dgobin | 0:d30842e497f7 | 14 | AnalogOut speaks(p18); |
dgobin | 0:d30842e497f7 | 15 | wave_player wplays(&speaks); |
dgobin | 0:d30842e497f7 | 16 | |
dgobin | 0:d30842e497f7 | 17 | //slider |
dgobin | 0:d30842e497f7 | 18 | AnalogIn slide(p15); |
dgobin | 0:d30842e497f7 | 19 | //dial |
dgobin | 0:d30842e497f7 | 20 | AnalogIn twist(p16); |
dgobin | 0:d30842e497f7 | 21 | //Motion |
dgobin | 0:d30842e497f7 | 22 | AnalogIn swipe(p19); |
dgobin | 0:d30842e497f7 | 23 | //boop |
dgobin | 0:d30842e497f7 | 24 | DigitalIn boop(p21); |
dgobin | 0:d30842e497f7 | 25 | //function |
dgobin | 0:d30842e497f7 | 26 | int chSig(int val, float sli, float twi); |