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
Fork of fistrek_intenzitetdiode by
Revision 4:a3ec775f889b, committed 2015-12-10
- Comitter:
- ffistrek
- Date:
- Thu Dec 10 16:46:10 2015 +0000
- Parent:
- 3:c9b8b2a4d481
- Child:
- 5:3dcf87833bbb
- Commit message:
- Fistrek_sinus;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Dec 10 14:51:21 2015 +0000
+++ b/main.cpp Thu Dec 10 16:46:10 2015 +0000
@@ -1,18 +1,15 @@
#include "mbed.h"
-int main()
-{
- DigitalOut led(LED1);
- DigitalIn sw(p5);
- sw.mode(PullUp);
- int counter=0;
- while(1)
- {
- if (sw==1)
- {
- counter++;
- }
- if((counter%9)==0){
- led = 1;
- }
- }
- }
\ No newline at end of file
+#define INPUT_SCALAR (0.01f)
+AnalogIn Ain(p20);
+ AnalogOut Aout(p18);
+ float i;
+ float pi=3.14159;
+ int main()
+ {
+ while(1) {
+ for (i=0; i<2; i=i+0.005) {
+ Aout=0.5+0.5*sin(i*pi);
+ wait(Ain*INPUT_SCALAR);
+ }
+ }
+ }
\ No newline at end of file
