This is the Mexican Standoff prototype made by Francisco Martin and Andrew Smith. Please refer to the following link for instructions on hardware hookup: https://developer.mbed.org/users/fomartin/notebook/mexican-standoff-reaction-game/
Dependencies: SDFileSystem mbed-rtos mbed wave_player 4DGL-uLCD-SE PinDetect
Hardware/Speaker.h@0:75716bd37804, 2016-03-14 (annotated)
- Committer:
- fomartin
- Date:
- Mon Mar 14 03:04:08 2016 +0000
- Revision:
- 0:75716bd37804
Mexican Standoff Prototype;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fomartin | 0:75716bd37804 | 1 | //#include "mbed.h" |
fomartin | 0:75716bd37804 | 2 | //// new class to play a note on Speaker based on PwmOut class |
fomartin | 0:75716bd37804 | 3 | //class Speaker |
fomartin | 0:75716bd37804 | 4 | //{ |
fomartin | 0:75716bd37804 | 5 | //public: |
fomartin | 0:75716bd37804 | 6 | // Speaker(PinName pin) : _pin(pin) { |
fomartin | 0:75716bd37804 | 7 | //// _pin(pin) means pass pin to the Speaker Constructor |
fomartin | 0:75716bd37804 | 8 | // } |
fomartin | 0:75716bd37804 | 9 | //// class method to play a note based on PwmOut class |
fomartin | 0:75716bd37804 | 10 | // void PlayNote(float frequency, float duration, float volume) { |
fomartin | 0:75716bd37804 | 11 | // _pin.period(1.0/frequency); |
fomartin | 0:75716bd37804 | 12 | // _pin = volume/2.0; |
fomartin | 0:75716bd37804 | 13 | // wait(duration); |
fomartin | 0:75716bd37804 | 14 | // _pin = 0.0; |
fomartin | 0:75716bd37804 | 15 | // } |
fomartin | 0:75716bd37804 | 16 | // |
fomartin | 0:75716bd37804 | 17 | //private: |
fomartin | 0:75716bd37804 | 18 | // PwmOut _pin; |
fomartin | 0:75716bd37804 | 19 | //}; |