test publish

Dependencies:   mbed GroveEarbudSensor

Files at this revision

API Documentation at this revision

Comitter:
antoineA
Date:
Mon Apr 11 13:46:08 2016 +0000
Parent:
8:e1beb2a9454e
Child:
11:e9d48f0a6b3e
Commit message:
GSRSensor class added

Changed in this revision

GSRSensor.cpp Show annotated file Show diff for this revision Revisions of this file
GSRSensor.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GSRSensor.cpp	Mon Apr 11 13:46:08 2016 +0000
@@ -0,0 +1,9 @@
+#include "GSRSensor.h"
+
+GSRSensor::GSRSensor(AnalogIn *pin){
+    input = pin;    
+}
+
+float GSRSensor::getGSRValue(){
+    return input->read();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GSRSensor.h	Mon Apr 11 13:46:08 2016 +0000
@@ -0,0 +1,15 @@
+#ifndef _GSR_SENSOR_H_
+#define _GSR_SENSOR_H_
+
+#include <mbed.h>
+
+class GSRSensor{
+public :
+    GSRSensor(AnalogIn *pin);
+    float getGSRValue();
+private :
+    AnalogIn *input;
+    
+};
+
+#endif
\ No newline at end of file
--- a/main.cpp	Mon Apr 11 13:30:35 2016 +0000
+++ b/main.cpp	Mon Apr 11 13:46:08 2016 +0000
@@ -5,11 +5,13 @@
 #include "Speaker.h"
 #include "MelodyGenerator.h"
 #include "Notes.h"
+#include "GSRSensor.h"
 #include <vector>
 
 using namespace std;
 
 InterruptIn earSensorPin(p5);
+AnalogIn GSRInput(p6);
 //DigitalOut led(LED1);
 PwmOut speakerPin(p21);