Oscar Schofield / Mbed 2 deprecated Elec350_OBS

Dependencies:   mbed

Committer:
Oschofield
Date:
Thu Oct 22 10:47:08 2015 +0000
Revision:
6:7c1b80df4de9
Added Microphone Classes and methods;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Oschofield 6:7c1b80df4de9 1 #ifndef _MICROPHONE_H_
Oschofield 6:7c1b80df4de9 2 #define _MICROPHONE_H_
Oschofield 6:7c1b80df4de9 3
Oschofield 6:7c1b80df4de9 4 #include "mbed.h"
Oschofield 6:7c1b80df4de9 5
Oschofield 6:7c1b80df4de9 6 class Microphone
Oschofield 6:7c1b80df4de9 7 {
Oschofield 6:7c1b80df4de9 8 private:
Oschofield 6:7c1b80df4de9 9 bool isStarted;
Oschofield 6:7c1b80df4de9 10 public:
Oschofield 6:7c1b80df4de9 11 // Constructor.
Oschofield 6:7c1b80df4de9 12 Microphone();
Oschofield 6:7c1b80df4de9 13
Oschofield 6:7c1b80df4de9 14 // Begins sampling data from the microphone using timer 3.
Oschofield 6:7c1b80df4de9 15 void start();
Oschofield 6:7c1b80df4de9 16
Oschofield 6:7c1b80df4de9 17 // Ends sampling (UNTESTED!)
Oschofield 6:7c1b80df4de9 18 void stop();
Oschofield 6:7c1b80df4de9 19
Oschofield 6:7c1b80df4de9 20 // Returns a signed 8-bit integer containing the latest data from the microphone.
Oschofield 6:7c1b80df4de9 21 int8_t read();
Oschofield 6:7c1b80df4de9 22 };
Oschofield 6:7c1b80df4de9 23
Oschofield 6:7c1b80df4de9 24 #endif
Oschofield 6:7c1b80df4de9 25