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: mbed MotorLab3Code
Diff: main.cpp
- Revision:
- 0:cb571e42343c
- Child:
- 1:5b2bc7ec7b14
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jan 30 21:05:23 2019 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include <iostream>
+Serial pc(USBTX, USBRX);
+
+AnalogIn AI_in(PTB0);
+PwmOut PWM_out(PTE20);
+
+float SP;
+float DC;
+
+int main() {
+ PWM_out.period(.05);
+
+ while(1) {
+ SP=AI_in;
+ DC=SP / 3.3;
+ PWM_out=DC * 100;
+ cout <<PWM_out.read() << endl;
+
+
+ }
+}