Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SerialInputReactionHandler AMPulseTrain SwArr16MOSFET StrCommandHandler KajiLabES
Diff: main.cpp
- Revision:
- 1:b97639dad576
- Parent:
- 0:19a67422961f
- Child:
- 2:5cb68cc8ecaa
--- a/main.cpp Tue Oct 23 15:11:18 2018 +0000
+++ b/main.cpp Wed Oct 23 20:08:31 2019 +0000
@@ -4,7 +4,9 @@
#include "sigbind.h"
#include <iostream>
#include <bitset>
-ProcessState pstate;
+ProcessState pstate = WAIT_A_CERTAIN_KEY;
+ElectrodeSpacing spacing = WIDE_CONDITION;
+StimulationMode smode = BIPOLAR;
Serial pc(USBTX, USBRX); // tx, rx
DigitalOut myled1(LED1);
@@ -19,7 +21,7 @@
int main()
{
- stimulator.DAADinit();
+ stimulator.init();
myled1 = 1;
pmrc.allHiZ();
myled2 = 1;
@@ -41,9 +43,29 @@
myled3 = 1;
pmrc.setPol(PMRC16ch::Cathodic);
while (pstate == MAIN_ROUTINE) {
+
+ for (int i = 0; i < 2; i++) {
+ switch(smode){
+ case BIPOLAR: pmrc.setPol((PMRC16ch::Polarity)i); break;
+ case CATHODIC: pmrc.setPol(PMRC16ch::Cathodic); break;
+ case ANODIC: pmrc.setPol(PMRC16ch::Anodic); break;
+ }
+ if(spacing == WIDE_CONDITION)
+ //pmrc.setTrio(3,1,5);
+ pmrc.setTwin(1, 2);
+ else
+ //pmrc.setTrio(3,2,4);
+ pmrc.setTwin(1, 3);
+ wait_us(pp-pw);
+ stimulator.DAAD(ph);
+ wait_us(pw);
+ stimulator.DAAD(0);
+ }
+ /*
for(int i = 0; i < 2; i++) {
- //pmrc.setTwin(i+1, (i+4)%8+1);
pmrc.setTwin(i+1, (i+1)%8+1);
+ //pmrc.setTwin(i+1, (i+1)%8+1);
+ //pmrc.setTwin(i+1, (i+1)%8+1);
//pmrc.setOvsO(i+1);
wait_us(pp-pw);
stimulator.DAAD(ph);
@@ -52,6 +74,7 @@
//pmrc.allHiZ();
//wait_us(pw);
}
+ */
if (pstate == TERMINATED) break;
}
}