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.
Fork of ele350 by
Diff: constant_app.cpp
- Revision:
- 34:498a218cf53e
- Parent:
- 31:6f781b2ebde6
- Child:
- 44:913bd7824dae
diff -r c084f49cd403 -r 498a218cf53e constant_app.cpp
--- a/constant_app.cpp Wed Dec 16 16:09:18 2015 +0000
+++ b/constant_app.cpp Thu Dec 17 09:55:33 2015 +0000
@@ -2,12 +2,13 @@
ConstantApp::ConstantApp(Serial* serial) : App("Constant Voltage", serial) {
this->analogOut = new AnalogOut (PA_4);
+ this->amplitude = 3.0f;
}
void ConstantApp::start()
{
App::start();
- this->analogOut->write(2.0/3.0);
+ this->analogOut->write(this->amplitude/3.0f);
this->timer.start();
}
@@ -23,4 +24,9 @@
this->analogOut->write(0);
this->timer.stop();
this->timer.reset();
+}
+
+void ConstantApp::setamplitude(float newamplitude)
+{
+ this->amplitude = newamplitude;
}
\ No newline at end of file
