Biorobotics / Mbed 2 deprecated Hidscope_encoder

Dependencies:   HIDScope mbed

main.cpp

Committer:
yohoo15
Date:
2015-09-23
Revision:
0:27d918875644

File content as of revision 0:27d918875644:

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


// Define pin for motor control
DigitalOut dirPin(D4);
DigitalOut PWM(D5);

// Define the HIDScope and Ticker object
HIDScope    scope(1);   // 
Ticker      scopeTimer;

// Read the analog input
AnalogIn    a0(PTC10);



 
// The data read and send function
void scopeSend()
{
    scope.set(0,a0.read());
    scope.send();
}


int main()
{
    // Attach the data read and send function at 100 Hz
    scopeTimer.attach_us(&scopeSend, 1e4);   
    
    while(1) { // let the motor run
        dirPin.write(0);
        PWM.write(1);
        
         }

        
        
        

}