Dependencies:   BLE_API mbed nRF51822

Fork of nRF51822_SimpleChat by Cristi Stoican

Revision:
6:832162614a19
Parent:
3:b6e4e5529a52
--- a/ProcessInterface.cpp	Mon May 08 21:57:59 2017 +0000
+++ b/ProcessInterface.cpp	Tue May 09 06:13:54 2017 +0000
@@ -1,7 +1,15 @@
 #include "ProcessInterface.hpp"
 
-ProcessInterface::ProcessInterface() : Output(0), cmd(0) {
+ProcessInterface::ProcessInterface() : Output(0), cmd(0), processRead(P0_4), cmdPin(P0_0) {
 	this->Ctrl = 0;
+	this->Btd = 0;
+	cmdPin.period(MIN_PWM_PERIOD);
+}
+
+ProcessInterface::ProcessInterface(PinName _analogPin, PinName _pwmPin) : Output(0), cmd(0), processRead(_analogPin), cmdPin(_pwmPin) {
+	this->Ctrl = 0;
+	this->Btd = 0;
+	cmdPin.period(MIN_PWM_PERIOD);
 }
 
 void ProcessInterface::attachController(Controller *_Ctrl) {
@@ -13,7 +21,7 @@
 }
 
 void ProcessInterface::getProcOutput() {
-	Output = input.read();
+	Output = processRead.read();
 }
 
 void ProcessInterface::exportOutput() {
@@ -29,12 +37,12 @@
 	cmd =_cmd;
 }
 
-void ProcessInterface::applyCmd() {}
+void ProcessInterface::applyCmd() {
+	cmdPin.write(cmd);	
+}
 
 
 ProcessInterface::~ProcessInterface() {
 	delete Ctrl;
 	delete Btd;
 }
-
-