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 penkich_test_percussion by
Diff: main.cpp
- Revision:
- 1:3252e4fbccab
- Parent:
- 0:e363f64b5744
- Child:
- 2:269fadd5d1f2
--- a/main.cpp Tue Aug 18 12:26:25 2015 +0000
+++ b/main.cpp Sun Aug 23 00:52:12 2015 +0000
@@ -1,18 +1,18 @@
#include "mbed.h"
-DigitalIn sw(dp9);
+DigitalIn sw(D7);
Ticker timer;
-PwmOut speaker(dp18);
+PwmOut speaker(D5);
Ticker envelope;
-PwmOut env(dp24);
+PwmOut env(D3);
static int tms_per10=0;
void env_out(void){
float attack_ms =10;
float decay_ms = 10;
- float sustain_ms = 200;
- float sustain = 0.5;
- float release_ms = 400;
+ float sustain_ms = 20;
+ float sustain = 0.2;
+ float release_ms = 5000;
float out_level;
tms_per10++;
@@ -26,7 +26,7 @@
}else if(tms_per10 > attack_ms * 10){
env.write(1.0f);
}else{
- out_level = 1.0/attack_ms * tms_per10;
+ out_level = 1.0f/attack_ms * tms_per10;
env.write(out_level);
}
}
