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.
Dependencies: Servo mbed biquadFilter
Diff: main.cpp
- Revision:
- 2:80d4ea87a2bb
- Parent:
- 1:93a041e62d7e
--- a/main.cpp Mon Oct 08 12:59:46 2018 +0000
+++ b/main.cpp Mon Oct 08 13:36:05 2018 +0000
@@ -1,24 +1,29 @@
// Continuously sweep the servo through it's full range
#include "mbed.h"
#include "Servo.h"
+#include "MODSERIAL.h"
Servo myservo(D7);
InterruptIn button(PTA4);
//InterruptIn button1(PTC6);
//DigitalOut myledgreen(LED_GREEN);
//DigitalOut myledred(LED_RED);
+MODSERIAL pc(USBTX, USBRX);
int main() {
+ pc.baud(115200);
while(1) {
+ char c;
+ c = pc.getc();
// Met een switch
- switch(button)
+ switch(c)
{
- case 0:
+ case 'h':
myservo = 0.5;
wait(0.01);
break;