Servo script + magnet driver for biorobotics project in Uni. Made by Teun van der Molen

Dependencies:   MODSERIAL Servo mbed

main.cpp

Committer:
teunman
Date:
2015-09-09
Revision:
0:05ecf16dcb7b
Child:
1:26baa438620b

File content as of revision 0:05ecf16dcb7b:

#include "mbed.h"
#include "HIDScope.h"
 
// Define the HIDScope and Ticker object
HIDScope    scope(1);
Ticker      scopeTimer;
 
// Read the analog input
AnalogIn    an_in(A0);
 
// The data read and send function
void scopeSend()
{
    scope.set(0,an_in.read());
    scope.send();
}
 
int main()
{
    // Attach the data read and send function at 100 Hz
    scopeTimer.attach_us(&scopeSend, 1e4);   
    
    while(1) { }
}