test halfgeleider

Dependencies:   HIDScope mbed

main.cpp

Committer:
Margreeth95
Date:
2015-10-28
Revision:
1:f2ec9d10960a
Parent:
0:b8edd42c7819

File content as of revision 1:f2ec9d10960a:

#include "mbed.h"
#include "HIDScope.h"

DigitalOut pin1(D4);
AnalogIn testpin(A0);
HIDScope scope (2);
Ticker  scope2;
Serial pc(USBTX, USBRX);

 void ScopeSend()
    {
        scope.set(0, pin1);
        scope.set(1, testpin);
        scope.send();
    }

int main()
{
    pc.baud(115200);
    scope2.attach(&ScopeSend, 0.002);

    while (true)
    {
     char c = pc.getc();
     
     if (c == 'f')
     {
        pin1 = (1);
        wait (2);
        pin1 = (0);
        wait(1);
     }
     
     else
     {
         pin1 = (0);
     }
    }

}