Sending LED voltage to HIDScope

Dependencies:   HIDScope mbed

main.cpp

Committer:
CasperK
Date:
2018-10-19
Revision:
6:1b644a7c3144
Parent:
3:43bd04c205e6

File content as of revision 6:1b644a7c3144:

#include "mbed.h"
//#include "FastPWM.h"
#include "HIDScope.h"

HIDScope scope(2);
PwmOut LED(D5);
Ticker ticker;
DigitalIn button(D3); 
AnalogIn potmeter(A5);

volatile float x;
volatile float y;
volatile float x_prev;

void ShowStuf()
{
    scope.set(0,potmeter);
    scope.set(1,x);
    scope.send();
}

int main()
{
    LED.period(0.00001f);
    ticker.attach(&ShowStuf, 0.001);
    x = 1;
    while (true) { 
            LED.write(potmeter);
            wait(0.5f);
    }
}

//