slave2

Dependencies:   PinDetect dsp mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
cpark308
Date:
Sun Apr 24 17:37:33 2016 +0000
Child:
1:caeb5792f292
Commit message:
slave code using old method

Changed in this revision

PinDetect.lib 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
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PinDetect.lib	Sun Apr 24 17:37:33 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/AjK/code/PinDetect/#cb3afc45028b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Apr 24 17:37:33 2016 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+#include "PinDetect.h"
+#include "rtos.h"
+
+DigitalOut myled(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled4(LED4);
+AnalogOut outfunction(p18);
+DigitalOut masterSignalOut(p26);
+InterruptIn trigger(p25);
+int counter;
+
+Timer ti;
+
+void analogScope(void const *args){
+    counter = 0;
+    myled = 0;
+    while(1){
+    //outfunction = (ti.read_us()%1000)*0.001;
+    //myled= (((ti.read_ms())>>10)%1);
+    outfunction = (counter%10)*0.1;
+    counter++;
+    myled = !myled;
+    }
+}
+void sendinterrupt(void){
+    masterSignalOut = 1;
+}
+void interruptrecv(void){
+    ti.reset();
+    myled4 = !myled4;
+    counter = 0;
+    masterSignalOut = 0;
+}
+int main() {
+    ti.reset();
+    myled2 = 0;
+    myled4 = 0;
+    masterSignalOut = 0;
+    Thread threadanalog(analogScope);
+    threadanalog.set_priority(osPriorityLow);
+    trigger.rise(&interruptrecv);
+    while(1) {
+        myled2 = !myled2;
+        Thread::wait(10000);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Sun Apr 24 17:37:33 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Apr 24 17:37:33 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f
\ No newline at end of file