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
Revision 3:94639c311dd1, committed 2015-08-30
- Comitter:
- hagi_hara
- Date:
- Sun Aug 30 05:45:12 2015 +0000
- Parent:
- 2:269fadd5d1f2
- Commit message:
- ???????
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 |
--- a/main.cpp Sun Aug 23 10:27:57 2015 +0000
+++ b/main.cpp Sun Aug 30 05:45:12 2015 +0000
@@ -1,6 +1,10 @@
#include "mbed.h"
-DigitalIn sw(D7);
+
+AnalogIn cds(A5);
+
+//シリアル通信設定
+Serial pc(USBTX, USBRX);
Ticker timer;
PwmOut speaker(D5);
@@ -39,14 +43,17 @@
int main()
{
- sw.mode(PullUp);
+ float cdsValue = cds;
while(1){
- if (sw ==0){
+ cdsValue = cds;
+ pc.printf("%f, ", cdsValue);
+ if (cds > 0.2){
tms_per10=0;
speaker.period_us(10);
env.period_us(10);
timer.attach_us(&sound_out,100); //10kHz
envelope.attach_us(&env_out,100); //10kHz
+ wait(1.0f);
}
wait(0.01f);
}
--- a/mbed.bld Sun Aug 23 10:27:57 2015 +0000 +++ b/mbed.bld Sun Aug 30 05:45:12 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c \ No newline at end of file
