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.
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);
}
}