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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Speaker.h Source File

Speaker.h

00001 //#include "mbed.h"
00002 //// new class to play a note on Speaker based on PwmOut class
00003 //class Speaker
00004 //{
00005 //public:
00006 //    Speaker(PinName pin) : _pin(pin) {
00007 //// _pin(pin) means pass pin to the Speaker Constructor
00008 //    }
00009 //// class method to play a note based on PwmOut class
00010 //    void PlayNote(float frequency, float duration, float volume) {
00011 //        _pin.period(1.0/frequency);
00012 //        _pin = volume/2.0;
00013 //        wait(duration);
00014 //        _pin = 0.0;
00015 //    }
00016 //
00017 //private:
00018 //    PwmOut _pin;
00019 //};