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.
Revision 0:e6a9e4183550, committed 2020-08-19
- Comitter:
- rudolf5020
- Date:
- Wed Aug 19 12:47:23 2020 +0000
- Commit message:
- question3
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Aug 19 12:47:23 2020 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+Serial pc(USBTX,USBRX);
+
+AnalogIn pot1(p19);/// potentiometer 1
+AnalogIn pot2(p20);//potentiometer 2
+PwmOut red(p23);//Pulse width modulator(red)
+PwmOut green(p24);//Pulse width modulator(green)
+
+
+int main(){
+ while (1) {
+ red = 1- pot1;
+ green = 1- pot2;
+ pc.printf("pot1 = %f pot2 = %f \r", pot1.read(),pot2.read());
+ wait (0.5); //wait half a second
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Aug 19 12:47:23 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file